1#include "simdjson/base.h"
2
3namespace simdjson {
4namespace internal {
5
6 SIMDJSON_DLLIMPORTEXPORT const error_code_info error_codes[] {
7 { .code: SUCCESS, .message: "No error" },
8 { .code: CAPACITY, .message: "This parser can't support a document that big" },
9 { .code: MEMALLOC, .message: "Error allocating memory, we're most likely out of memory" },
10 { .code: TAPE_ERROR, .message: "The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc." },
11 { .code: DEPTH_ERROR, .message: "The JSON document was too deep (too many nested objects and arrays)" },
12 { .code: STRING_ERROR, .message: "Problem while parsing a string" },
13 { .code: T_ATOM_ERROR, .message: "Problem while parsing an atom starting with the letter 't'" },
14 { .code: F_ATOM_ERROR, .message: "Problem while parsing an atom starting with the letter 'f'" },
15 { .code: N_ATOM_ERROR, .message: "Problem while parsing an atom starting with the letter 'n'" },
16 { .code: NUMBER_ERROR, .message: "Problem while parsing a number" },
17 { .code: UTF8_ERROR, .message: "The input is not valid UTF-8" },
18 { .code: UNINITIALIZED, .message: "Uninitialized" },
19 { .code: EMPTY, .message: "Empty: no JSON found" },
20 { .code: UNESCAPED_CHARS, .message: "Within strings, some characters must be escaped, we found unescaped characters" },
21 { .code: UNCLOSED_STRING, .message: "A string is opened, but never closed." },
22 { .code: UNSUPPORTED_ARCHITECTURE, .message: "simdjson does not have an implementation supported by this CPU architecture (perhaps it's a non-SIMD CPU?)." },
23 { .code: INCORRECT_TYPE, .message: "The JSON element does not have the requested type." },
24 { .code: NUMBER_OUT_OF_RANGE, .message: "The JSON number is too large or too small to fit within the requested type." },
25 { .code: INDEX_OUT_OF_BOUNDS, .message: "Attempted to access an element of a JSON array that is beyond its length." },
26 { .code: NO_SUCH_FIELD, .message: "The JSON field referenced does not exist in this object." },
27 { .code: IO_ERROR, .message: "Error reading the file." },
28 { .code: INVALID_JSON_POINTER, .message: "Invalid JSON pointer syntax." },
29 { .code: INVALID_URI_FRAGMENT, .message: "Invalid URI fragment syntax." },
30 { .code: UNEXPECTED_ERROR, .message: "Unexpected error, consider reporting this problem as you may have found a bug in simdjson" },
31 { .code: PARSER_IN_USE, .message: "Cannot parse a new document while a document is still in use." },
32 { .code: OUT_OF_ORDER_ITERATION, .message: "Objects and arrays can only be iterated when they are first encountered." },
33 { .code: INSUFFICIENT_PADDING, .message: "simdjson requires the input JSON string to have at least SIMDJSON_PADDING extra bytes allocated, beyond the string's length. Consider using the simdjson::padded_string class if needed." },
34 { .code: INCOMPLETE_ARRAY_OR_OBJECT, .message: "JSON document ended early in the middle of an object or array." },
35 { .code: SCALAR_DOCUMENT_AS_VALUE, .message: "A JSON document made of a scalar (number, Boolean, null or string) is treated as a value. Use get_bool(), get_double(), etc. on the document instead. "},
36 { .code: OUT_OF_BOUNDS, .message: "Attempted to access location outside of document."},
37 { .code: TRAILING_CONTENT, .message: "Unexpected trailing content in the JSON input."}
38 }; // error_messages[]
39
40} // namespace internal
41} // namespace simdjson