equal
deleted
inserted
replaced
12 |
12 |
13 #include "error_private.h" |
13 #include "error_private.h" |
14 |
14 |
15 const char* ERR_getErrorString(ERR_enum code) |
15 const char* ERR_getErrorString(ERR_enum code) |
16 { |
16 { |
|
17 #ifdef ZSTD_STRIP_ERROR_STRINGS |
|
18 (void)code; |
|
19 return "Error strings stripped"; |
|
20 #else |
17 static const char* const notErrorCode = "Unspecified error code"; |
21 static const char* const notErrorCode = "Unspecified error code"; |
18 switch( code ) |
22 switch( code ) |
19 { |
23 { |
20 case PREFIX(no_error): return "No error detected"; |
24 case PREFIX(no_error): return "No error detected"; |
21 case PREFIX(GENERIC): return "Error (generic)"; |
25 case PREFIX(GENERIC): return "Error (generic)"; |
37 case PREFIX(dictionary_corrupted): return "Dictionary is corrupted"; |
41 case PREFIX(dictionary_corrupted): return "Dictionary is corrupted"; |
38 case PREFIX(dictionary_wrong): return "Dictionary mismatch"; |
42 case PREFIX(dictionary_wrong): return "Dictionary mismatch"; |
39 case PREFIX(dictionaryCreation_failed): return "Cannot create Dictionary from provided samples"; |
43 case PREFIX(dictionaryCreation_failed): return "Cannot create Dictionary from provided samples"; |
40 case PREFIX(dstSize_tooSmall): return "Destination buffer is too small"; |
44 case PREFIX(dstSize_tooSmall): return "Destination buffer is too small"; |
41 case PREFIX(srcSize_wrong): return "Src size is incorrect"; |
45 case PREFIX(srcSize_wrong): return "Src size is incorrect"; |
|
46 case PREFIX(dstBuffer_null): return "Operation on NULL destination buffer"; |
42 /* following error codes are not stable and may be removed or changed in a future version */ |
47 /* following error codes are not stable and may be removed or changed in a future version */ |
43 case PREFIX(frameIndex_tooLarge): return "Frame index is too large"; |
48 case PREFIX(frameIndex_tooLarge): return "Frame index is too large"; |
44 case PREFIX(seekableIO): return "An I/O error occurred when reading/seeking"; |
49 case PREFIX(seekableIO): return "An I/O error occurred when reading/seeking"; |
45 case PREFIX(maxCode): |
50 case PREFIX(maxCode): |
46 default: return notErrorCode; |
51 default: return notErrorCode; |
47 } |
52 } |
|
53 #endif |
48 } |
54 } |