[Groonga-commit] groonga/groonga at 7e9792c [column-remove-show-more-detail-in-error-message] column_remove: show more detail in error message

Back to archive index

Masafumi Yokoyama null+****@clear*****
Thu Feb 11 22:22:03 JST 2016


Masafumi Yokoyama	2016-02-11 22:22:03 +0900 (Thu, 11 Feb 2016)

  New Revision: 7e9792cea1a536a4cac75437cf65a1bc1c281490
  https://github.com/groonga/groonga/commit/7e9792cea1a536a4cac75437cf65a1bc1c281490

  Message:
    column_remove: show more detail in error message

  Added files:
    test/command/suite/column_remove/nonexistent.expected
    test/command/suite/column_remove/nonexistent.test
  Modified files:
    lib/proc.c

  Modified: lib/proc.c (+5 -2)
===================================================================
--- lib/proc.c    2016-02-10 18:41:21 +0900 (6d155c2)
+++ lib/proc.c    2016-02-11 22:22:03 +0900 (0656a2c)
@@ -1687,10 +1687,13 @@ proc_column_remove(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_
     if (col) {
       grn_obj_remove(ctx, col);
     } else {
-      ERR(GRN_INVALID_ARGUMENT, "column not found.");
+      ERR(GRN_INVALID_ARGUMENT, "[column][remove] column isn't found: <%.*s.%.*s>",
+          (int)GRN_TEXT_LEN(VAR(0)), GRN_TEXT_VALUE(VAR(0)),
+          (int)GRN_TEXT_LEN(VAR(1)), GRN_TEXT_VALUE(VAR(1)));
     }
   } else {
-    ERR(GRN_INVALID_ARGUMENT, "table not found.");
+    ERR(GRN_INVALID_ARGUMENT, "[column][remove] table isn't found: <%.*s>",
+        (int)GRN_TEXT_LEN(VAR(0)), GRN_TEXT_VALUE(VAR(0)));
   }
   GRN_OUTPUT_BOOL(!ctx->rc);
   return NULL;

  Added: test/command/suite/column_remove/nonexistent.expected (+8 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_remove/nonexistent.expected    2016-02-11 22:22:03 +0900 (e07614e)
@@ -0,0 +1,8 @@
+column_remove Users name
+[[[-22,0.0,0.0],"[column][remove] table isn't found: <Users>"],false]
+#|e| [column][remove] table isn't found: <Users>
+table_create Users TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+column_remove Users name
+[[[-22,0.0,0.0],"[column][remove] column isn't found: <Users.name>"],false]
+#|e| [column][remove] column isn't found: <Users.name>

  Added: test/command/suite/column_remove/nonexistent.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_remove/nonexistent.test    2016-02-11 22:22:03 +0900 (90e7b5c)
@@ -0,0 +1,4 @@
+column_remove Users name
+
+table_create Users TABLE_PAT_KEY ShortText
+column_remove Users name
-------------- next part --------------
HTML����������������������������...
Download 



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