[Groonga-commit] groonga/gcs [master] Return "domainName" as the validated field

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Nov 15 17:22:38 JST 2012


YUKI Hiroshi	2012-11-15 17:22:38 +0900 (Thu, 15 Nov 2012)

  New Revision: 8804b3e122dacbb5f7306f18a1f6d9c4aa6bcc65
  https://github.com/groonga/gcs/commit/8804b3e122dacbb5f7306f18a1f6d9c4aa6bcc65

  Log:
    Return "domainName" as the validated field

  Modified files:
    lib/api/2011-02-01/configuration.js

  Modified: lib/api/2011-02-01/configuration.js (+18 -2)
===================================================================
--- lib/api/2011-02-01/configuration.js    2012-11-15 17:21:49 +0900 (1194825)
+++ lib/api/2011-02-01/configuration.js    2012-11-15 17:22:38 +0900 (af8a5d8)
@@ -123,7 +123,15 @@ function createDomainStatus(options) {
 }
 
 handlers.CreateDomain = function(context, request, response, config) {
-  var domain = new Domain(request.query.DomainName || '', context);
+  var domain;
+  try {
+    domain = new Domain(request.query.DomainName || '', context);
+  } catch(error) {
+    if (error.isValidationError) {
+      error.message = error.message.replace(/%VALIDATED_FIELD_NAME%/g, 'domainName');
+      throw error;
+    }
+  }
   if (!domain.exists())
     domain.createSync();
   var result = createDomainStatus({
@@ -136,7 +144,15 @@ handlers.CreateDomain = function(context, request, response, config) {
 };
 
 handlers.DeleteDomain = function(context, request, response, config) {
-  var domain = new Domain(request.query.DomainName || '', context);
+  var domain;
+  try {
+    domain = new Domain(request.query.DomainName || '', context);
+  } catch(error) {
+    if (error.isValidationError) {
+      error.message = error.message.replace(/%VALIDATED_FIELD_NAME%/g, 'domainName');
+      throw error;
+    }
+  }
   var result;
   if (domain.exists()) {
     domain.deleteSync();
-------------- next part --------------
HTML����������������������������...
下载 



More information about the Groonga-commit mailing list
Back to archive index