| 1 | /* |
| 2 | * This Source Code Form is subject to the terms of the Mozilla Public |
| 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 5 | * |
| 6 | * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. |
| 7 | */ |
| 8 | |
| 9 | /* |
| 10 | * The error strings are geared at answering the question "what happened". |
| 11 | * Optional information about "why it happened" is added |
| 12 | * as local strings in the code base with possibly runtime information. |
| 13 | * Information on "how to avoid it" is sporadically added using expected values. |
| 14 | * |
| 15 | * General considerations on error classes are summarized below: |
| 16 | * MAL_MALLOC_FAIL |
| 17 | * An operation allocates space for an object failed. |
| 18 | * Either the pre-requisites are not satisfied, or the system |
| 19 | * runs low on resources and can not accomodate the object. |
| 20 | * For failures to create BATs it sometimes indicates that an |
| 21 | * intermediate BAT size is too large. |
| 22 | * OPERATION_FAILED |
| 23 | * Mostly the module and function name are indicative enough. |
| 24 | * If possible more is said about the error context, |
| 25 | * informative references to arguments or variables, |
| 26 | * provided it is produced by the underlying implementation. |
| 27 | * GDK_EXCEPTION |
| 28 | * In general these are generated deep inside the kernel. |
| 29 | * They are captured by the MAL interpreter. |
| 30 | * SEMANTIC_* |
| 31 | * The patterns can be used to defer semantic type errors |
| 32 | * to runtime. |
| 33 | * |
| 34 | * Getting all exception strings in one place improves consistency |
| 35 | * and maintenance. |
| 36 | * |
| 37 | * At a later stage we could introduce internationalization support, i.e. |
| 38 | * use a translation table where needed. |
| 39 | */ |
| 40 | #ifndef MAL_ERRORS |
| 41 | #define MAL_ERRORS |
| 42 | |
| 43 | #define SQLSTATE(sqlstate) #sqlstate "!" |
| 44 | |
| 45 | #define MANUAL_HELP "See documentation for details" |
| 46 | |
| 47 | #define PROGRAM_GENERAL "Program contains errors." |
| 48 | #define PROGRAM_NYI "Not yet implemented" |
| 49 | |
| 50 | #define SYNTAX_GENERAL "Syntax error detected." |
| 51 | #define SYNTAX_SIGNATURE "Function signature missing." |
| 52 | |
| 53 | #define SEMANTIC_GENERAL "Semantic errors detected" |
| 54 | #define SEMANTIC_PROGRAM_ERRORS "Program contains semantic errors." |
| 55 | #define SEMANTIC_SIGNATURE_MISSING "Function signature missing." |
| 56 | #define SEMANTIC_OPERATION_MISSING "Operation not found." |
| 57 | #define SEMANTIC_TYPE_ERROR "Explicit type required" |
| 58 | #define SEMANTIC_TYPE_MISMATCH "Type mismatch" |
| 59 | |
| 60 | #define INTERNAL_BAT_ACCESS "Internal error, can not access BAT." |
| 61 | #define INTERNAL_BAT_HEAD "BAT has wrong head type" |
| 62 | #define INTERNAL_OBJ_CREATE "Can not create object" |
| 63 | #define INTERNAL_AUTHORIZATION "authorization BATs not empty" |
| 64 | |
| 65 | #define MAL_MALLOC_FAIL "Could not allocate space" |
| 66 | #define MAL_STACK_FAIL "Running out of stack space." |
| 67 | #define MAL_CALLDEPTH_FAIL "Recursive call limit reached." |
| 68 | |
| 69 | #define INVCRED_ACCESS_DENIED "access denied for user" |
| 70 | #define INVCRED_INVALID_USER "invalid credentials for user" |
| 71 | #define INVCRED_REMOVE_USER "Can not remove user" |
| 72 | #define INVCRED_WRONG_ID "Undefined client id" |
| 73 | |
| 74 | #define RUNTIME_IO_EOF "Attempt to read beyond end-of-file" |
| 75 | #define RUNTIME_FILE_NOT_FOUND "File not found" |
| 76 | #define RUNTIME_UNLINK "File could not be unlinked" |
| 77 | #define RUNTIME_DIR_ERROR "Unable to open directory" |
| 78 | #define RUNTIME_CREATE_ERROR "Unable to create file/directory" |
| 79 | #define RUNTIME_STREAM_FAILED "Could not create stream" |
| 80 | #define RUNTIME_STREAM_WRITE "Could not write to stream" |
| 81 | #define RUNTIME_STREAM_INPUT "Could not read from stream" |
| 82 | |
| 83 | #define RUNTIME_LOAD_ERROR "Loading error" |
| 84 | #define RUNTIME_OBJECT_MISSING "Object not found" |
| 85 | #define RUNTIME_SIGNATURE_MISSING "The <module>.<function> not found" |
| 86 | #define RUNTIME_OBJECT_UNDEFINED "Object not found" |
| 87 | #define RUNTIME_UNKNOWN_INSTRUCTION "Instruction type not supported" |
| 88 | #define RUNTIME_QRY_TIMEOUT "Query aborted due to timeout" |
| 89 | #define RUNTIME_SESSION_TIMEOUT "Query aborted due to session timeout" |
| 90 | #define OPERATION_FAILED "operation failed" |
| 91 | |
| 92 | #define BOX_CLOSED "Box is not open" |
| 93 | |
| 94 | #define SABAOTH_NOT_INITIALIZED "Sabaoth not initialized" |
| 95 | #define SABAOTH_USE_RESTRICTION "Sabaoth was not initialized as active database" |
| 96 | |
| 97 | #define SCENARIO_NOT_FOUND "Scenario not initialized" |
| 98 | |
| 99 | #define MACRO_SYNTAX_ERROR "RETURN statement is not the last one" |
| 100 | #define MACRO_DUPLICATE "Duplicate macro expansion" |
| 101 | #define MACRO_TOO_DEEP "Too many macro expansions" |
| 102 | |
| 103 | #define OPTIMIZER_CYCLE "Too many optimization cycles" |
| 104 | |
| 105 | #define ILLARG_NOTNIL " NIL not allowed" |
| 106 | #define ILLARG_CONSTANTS "Constant argument required" |
| 107 | |
| 108 | #define ILLEGAL_ARGUMENT "Illegal argument" |
| 109 | #define IDENTIFIER_EXPECTED "Identifier expected" |
| 110 | #define POSITIVE_EXPECTED "Argument must be positive" |
| 111 | #define ARGUMENT_TOO_LARGE "Argument too large" |
| 112 | #define TOO_MANY_BITS "Too many bits" |
| 113 | #define DUPLICATE_DEFINITION "Duplicate definition" |
| 114 | #define RANGE_ERROR "Range error" |
| 115 | |
| 116 | #define SERVER_STOPPED "Server stopped" |
| 117 | |
| 118 | #define XML_PARSE_ERROR "Document parse error" |
| 119 | #define "Comment may not contain '--'" |
| 120 | #define XML_PI_ERROR "No processing instruction target specified" |
| 121 | #define XML_VERSION_ERROR "Illegal XML version" |
| 122 | #define XML_STANDALONE_ERROR "Illegal XML standalone value" |
| 123 | #define XML_NOT_WELL_FORMED "Resulting document not well-formed" |
| 124 | #define XML_ATTRIBUTE_ERROR "No attribute name specified" |
| 125 | #define XML_ATTRIBUTE_INVALID "Invalid attribute name" |
| 126 | #define XML_NO_ELEMENT "No element name specified" |
| 127 | #define XML_NO_NAMESPACE "Namespace support not implemented" |
| 128 | #define XML_ILLEGAL_NAMESPACE "Illegal namespace" |
| 129 | #define XML_ILLEGAL_ATTRIBUTE "Illegal attribute" |
| 130 | #define XML_ILLEGAL_CONTENT "Illegal content" |
| 131 | |
| 132 | #define GDK_EXCEPTION "GDK reported error." |
| 133 | #define MAL_DEPRECATED "Deprecated MAL operation." |
| 134 | |
| 135 | #define TYPE_NOT_SUPPORTED "Type is not supported" |
| 136 | #endif /* MAL_ERRORS */ |
| 137 | |