[Groonga-commit] groonga/groonga at b3ca799 [master] Use more useful error message

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Thu Jun 22 10:22:03 JST 2017


Kouhei Sutou	2017-06-22 10:22:03 +0900 (Thu, 22 Jun 2017)

  New Revision: b3ca7993f09b51683dab39a2dab4ad6315031ac2
  https://github.com/groonga/groonga/commit/b3ca7993f09b51683dab39a2dab4ad6315031ac2

  Message:
    Use more useful error message

  Modified files:
    lib/geo.c

  Modified: lib/geo.c (+20 -3)
===================================================================
--- lib/geo.c    2017-06-22 09:39:58 +0900 (d2582e2)
+++ lib/geo.c    2017-06-22 10:22:03 +0900 (a8d6475)
@@ -1,5 +1,6 @@
 /* -*- c-basic-offset: 2 -*- */
-/* Copyright(C) 2009-2013 Brazil
+/*
+  Copyright(C) 2009-2017 Brazil
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -711,8 +712,24 @@ grn_geo_table_sort(grn_ctx *ctx, grn_obj *table, int offset, int limit,
     grn_id tid;
     grn_pat *pat = (grn_pat *)grn_ctx_at(ctx, index->header.domain);
     if (!pat) {
-      ERR(GRN_INVALID_ARGUMENT, "grn_ctx_at(): unknown grn_id"
-          "index->header.domain:%d", index->header.domain);
+      char index_name[GRN_TABLE_MAX_KEY_SIZE];
+      int index_name_size;
+      char lexicon_name[GRN_TABLE_MAX_KEY_SIZE];
+      int lexicon_name_size;
+      index_name_size = grn_obj_name(ctx,
+                                     index,
+                                     index_name,
+                                     GRN_TABLE_MAX_KEY_SIZE);
+      lexicon_name_size = grn_table_get_key(ctx,
+                                            grn_ctx_db(ctx),
+                                            index->header.domain,
+                                            lexicon_name,
+                                            GRN_TABLE_MAX_KEY_SIZE);
+      ERR(GRN_INVALID_ARGUMENT,
+          "[sort][geo] lexicon is broken: <%.*s>: <%.*s>(%d)",
+          index_name_size, index_name,
+          lexicon_name_size, lexicon_name,
+          index->header.domain);
       GRN_API_RETURN(i);
     }
     grn_id domain = pat->obj.header.domain;
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る