e514c95429c67b68bf3cd7af33f91745a0caa171
[yaz-moved-to-github.git] / srw / srw-diag.c
1 /* $Id: srw-diag.c,v 1.1 2003-01-06 08:20:28 adam Exp $
2    Copyright (C) 2002-2003
3    Index Data Aps
4
5 This file is part of the YAZ toolkit.
6
7 See the file LICENSE.
8 */
9
10 #include <yaz/srw-util.h>
11
12 static struct {
13     int code;
14     char *msg;
15 } msg_tab[] = {
16 /* General Diagnostics*/
17 {1, "Permanent system error"},
18 {2, "System temporarily unavailable"},
19 {3, "Authentication error"},
20 /* Diagnostics Relating to CQL*/
21 {10, "Illegal query"},
22 {11, "Unsupported query type (XCQL vs CQL)"},
23 {12, "Too many characters in query"},
24 {13, "Unbalanced or illegal use of parentheses"},
25 {14, "Unbalanced or illegal use of quotes"},
26 {15, "Illegal or unsupported index set"},
27 {16, "Illegal or unsupported index"},
28 {17, "Illegal or unsupported combination of index and index set"},
29 {18, "Illegal or unsupported combination of indexes"},
30 {19, "Illegal or unsupported relation"},
31 {20, "Illegal or unsupported relation modifier"},
32 {21, "Illegal or unsupported combination of relation modifers"},
33 {22, "Illegal or unsupported combination of relation and index"},
34 {23, "Too many characters in term"},
35 {24, "Illegal combination of relation and term"},
36 {25, "Special characters not quoted in term"},
37 {26, "Non special character escaped in term"},
38 {27, "Empty term unsupported"},
39 {28, "Masking character not supported"},
40 {29, "Masked words too short"},
41 {30, "Too many masking characters in term"},
42 {31, "Anchoring character not supported"},
43 {32, "Anchoring character in illegal or unsupported position"},
44 {33, "Combination of proximity/adjacency and masking characters not supported"},
45 {34, "Combination of proximity/adjacency and anchoring characters not supported"},
46 {35, "Terms only exclusion (stop) words"},
47 {36, "Term in invalid format for index or relation"},
48 {37, "Illegal or unsupported boolean operator"},
49 {38, "Too many boolean operators in query"},
50 {39, "Proximity not supported"},
51 {40, "Illegal or unsupported proximity relation"},
52 {41, "Illegal or unsupported proximity distance"},
53 {42, "Illegal or unsupported proximity unit"},
54 {43, "Illegal or unsupported proximity ordering"},
55 {44, "Illegal or unsupported combination of proximity modifiers"},
56 {45, "Index set name (prefix) assigned to multiple identifiers"},
57 /* Diagnostics Relating to Result Sets*/
58 {50, "Result sets not supported"},
59 {51, "Result set does not exist"},
60 {52, "Result set temporarily unavailable"},
61 {53, "Result sets only supported for retrieval"},
62 {54, "Retrieval may only occur from an existing result set"},
63 {55, "Combination of result sets with search terms not supported"},
64 {56, "Only combination of single result set with search terms supported"},
65 {57, "Result set created but no records available"},
66 {58, "Result set created with unpredictable partial results available"},
67 {59, "Result set created with valid partial results available"},
68 /* Diagnostics Relating to Records*/
69 {60, "Too many records retrieved"},
70 {61, "First record position out of range"},
71 {62, "Negative number of records requested"},
72 {63, "System error in retrieving records"},
73 {64, "Record temporarily unavailable"},
74 {65, "Record does not exist"},
75 {66, "Unknown schema for retrieval"},
76 {67, "Record not available in this schema"},
77 {68, "Not authorised to send record"},
78 {69, "Not authorised to send record in this schema"},
79 {70, "Record too large to send"},
80 /* Diagnostics Relating to Sorting*/
81 {80, "Sort not supported"},
82 {81, "Unsupported sort type (sortKeys vs xSortKeys)"},
83 {82, "Illegal or unsupported sort sequence"},
84 {83, "Too many records"},
85 {84, "Too many sort keys"},
86 {85, "Duplicate sort keys"},
87 {86, "Incompatible record formats"},
88 {87, "Unsupported schema for sort"},
89 {88, "Unsupported tag path for sort"},
90 {89, "Tag path illegal or unsupported for schema"},
91 {90, "Illegal or unsupported direction value"},
92 {91, "Illegal or unsupported case value"},
93 {92, "Illegal or unsupported missing value action"},
94 /* Diagnostics Relating to Explain*/
95 {100, "Explain not supported"},
96 {101, "Explain request type not supported (SOAP vs GET)"},
97 {102, "Explain record temporarily unavailable"},
98 {0, 0}
99 };
100
101 const char *yaz_srw_diag_str (int code)
102 {
103     int i;
104     for (i=0; msg_tab[i].msg; i++)
105         if (msg_tab[i].code == code)
106             return msg_tab[i].msg;
107     return "Unknown error";
108 }