icedb  version 0.5.1
Snow particle scattering database API
errorTypes.cpp
Go to the documentation of this file.
1 #include "../icedb/errorTypes.hpp"
2 namespace icedb {
3  namespace error {
4  const char* stringify(error_types et) {
5  if (et == error_types::xDivByZero) return "Division by zero.";
6  else if (et == error_types::xInvalidRange) return "Invalid range.";
7  else if (et == error_types::xAssert) return "Assertion failed.";
8  else if (et == error_types::xBadInput) return "Bad or nonsensical input.";
9  else if (et == error_types::xNullPointer) return "An unexpected null pointer was encountered.";
10  else if (et == error_types::xModelOutOfRange) return "Model out of range.";
11  else if (et == error_types::xMissingFrequency) return "Missing data for this frequency.";
12  else if (et == error_types::xEmptyInputFile) return "Input file is empty.";
13  else if (et == error_types::xMissingFolder) return "Missing folder in path.";
14  else if (et == error_types::xMissingFile) return "Missing file.";
15  else if (et == error_types::xMissingVariable) return "Missing variable in a saved structure.";
16  else if (et == error_types::xMissingConfigurationFile) return "Cannot find an appropriate configuration file.";
17  else if (et == error_types::xFileExists) return "File to be opened for writing already exists.";
18  else if (et == error_types::xPathExistsWrongType) return "Path exists, but wrong type (i.e. file vs. directory).";
19  else if (et == error_types::xTypeMismatch) return "Variable does not have the correct type.";
20  else if (et == error_types::xUnknownFileFormat) return "Unknown file format.";
21  else if (et == error_types::xMissingKey) return "Key not found in map.";
22  else if (et == error_types::xMissingHash) return "Cannot find hash to load.";
23  else if (et == error_types::xKeyExists) return "Key already exists in map.";
24  else if (et == error_types::xUnimplementedFunction) return "Unimplemented function.";
25  else if (et == error_types::xFallbackTemplate) return "Reached point in code that is the fallback template. Missing the appropriate template specialization.";
26  else if (et == error_types::xArrayOutOfBounds) return "An array went out of bounds.";
27  else if (et == error_types::xDimensionMismatch) return "An array went out of bounds.";
28  else if (et == error_types::xSingular) return "Singular matrix detected.";
29  else if (et == error_types::xDLLversionMismatch) return "Attempting to load a DLL that is compiled against an incompatible library version.";
30  else if (et == error_types::xDuplicateHook) return "Attempting to load same DLL twice.";
31  else if (et == error_types::xHandleInUse) return "DLL handle is currently in use, but the code wants to overwrite it.";
32  else if (et == error_types::xHandleNotOpen) return "Attempting to access unopened DLL handle.";
33  else if (et == error_types::xSymbolNotFound) return "Cannot find symbol in DLL.";
34  else if (et == error_types::xBadFunctionMap) return "DLL symbol function map table is invalid.";
35  else if (et == error_types::xBadFunctionReturn) return "DLL symbol map table is invalid.";
36  else if (et == error_types::xBlockedHookLoad) return "Another hook blocked the load operation (for DLLs).";
37  else if (et == error_types::xBlockedHookUnload) return "Another DLL depends on the one that you are unloading.";
38  else if (et == error_types::xDLLerror) return "Unspecified DLL ICEDB_LOG_ERROR.";
39  else if (et == error_types::xUpcast) return "Plugin failure: cannot cast base upwards to a derived class provided by a plugin. Usually means that no matching plugin can be found.";
40  else if (et == error_types::xCannotFindReference) return "Cannot find reference in file.";
41  else if (et == error_types::xOtherError) return "Nonspecific ICEDB_LOG_ERROR.";
42  else if (et == error_types::xUnsupportedIOaction) return "Unsupported IO action.";
43  else return "INVALID - stringify does not have the appropriate ICEDB_LOG_ERROR type!";
44  }
45  }
46 }
DL_ICEDB void stringify(error_code_t err, std::string &res)
Definition: error.cpp:307