LibraryLink Utilities  3.0.1
Modern C++ wrapper over LibraryLink and WSTP
Errors.h
Go to the documentation of this file.
1 
7 #ifndef LLU_ERRORLOG_ERRORS_H
8 #define LLU_ERRORLOG_ERRORS_H
9 
10 #include <string>
11 
12 namespace LLU {
13 
17  namespace ErrorCode {
18 
19  // Original LibraryLink error codes:
20  constexpr int VersionError = 7;
21  constexpr int FunctionError = 6;
22  constexpr int MemoryError = 5;
23  constexpr int NumericalError = 4;
24  constexpr int DimensionsError = 3;
25  constexpr int RankError = 2;
26  constexpr int TypeError = 1;
27  constexpr int NoError = 0;
28  } // namespace ErrorCode
29 
33  namespace ErrorName {
34 
35  // Original LibraryLink error codes:
36  extern const std::string VersionError;
37  extern const std::string FunctionError;
38  extern const std::string MemoryError;
39  extern const std::string NumericalError;
40  extern const std::string DimensionsError;
41  extern const std::string RankError;
42  extern const std::string TypeError;
43  extern const std::string NoError;
44 
45  // LibraryData errors
46  extern const std::string LibDataError;
47 
48  // MArgument errors:
49  extern const std::string MArgumentIndexError;
50  extern const std::string MArgumentNumericArrayError;
51  extern const std::string MArgumentTensorError;
52  extern const std::string MArgumentImageError;
53 
54  // ErrorManager errors:
55  extern const std::string ErrorManagerThrowIdError;
56  extern const std::string ErrorManagerThrowNameError;
57  extern const std::string ErrorManagerCreateNameError;
58 
59  // NumericArray errors:
60  extern const std::string NumericArrayNewError;
61  extern const std::string NumericArrayCloneError;
62  extern const std::string NumericArrayTypeError;
63  extern const std::string NumericArraySizeError;
64  extern const std::string NumericArrayIndexError;
65  extern const std::string NumericArrayConversionError;
66 
67  // MTensor errors:
68  extern const std::string TensorNewError;
69  extern const std::string TensorCloneError;
70  extern const std::string TensorTypeError;
71  extern const std::string TensorSizeError;
72  extern const std::string TensorIndexError;
73 
74  // SparseArray errors:
75  extern const std::string SparseArrayCloneError;
76  extern const std::string SparseArrayTypeError;
77  extern const std::string SparseArrayFromPositionsError;
78  extern const std::string SparseArrayFromTensorError;
79  extern const std::string SparseArrayImplicitValueResetError;
80  extern const std::string SparseArrayImplicitValueError;
81  extern const std::string SparseArrayExplicitValuesError;
82  extern const std::string SparseArrayRowPointersError;
83  extern const std::string SparseArrayColumnIndicesError;
84  extern const std::string SparseArrayExplicitPositionsError;
85  extern const std::string SparseArrayToTensorError;
86 
87  // MImage errors:
88  extern const std::string ImageNewError;
89  extern const std::string ImageCloneError;
90  extern const std::string ImageTypeError;
91  extern const std::string ImageSizeError;
92  extern const std::string ImageIndexError;
93 
94  // General container errors:
95  extern const std::string CreateFromNullError;
96  extern const std::string MArrayElementIndexError;
97  extern const std::string MArrayDimensionIndexError;
98 
99  // WSTP errors:
100  extern const std::string WSNullWSLinkError;
101  extern const std::string WSTestHeadError;
102  extern const std::string WSPutSymbolError;
103  extern const std::string WSPutFunctionError;
104  extern const std::string WSTestSymbolError;
105  extern const std::string WSWrongSymbolForBool;
106  extern const std::string WSGetListError;
107  extern const std::string WSGetScalarError;
108  extern const std::string WSGetStringError;
109  extern const std::string WSGetArrayError;
110  extern const std::string WSPutListError;
111  extern const std::string WSPutScalarError;
112  extern const std::string WSPutStringError;
113  extern const std::string WSPutArrayError;
114  extern const std::string WSGetSymbolError;
115  extern const std::string WSGetFunctionError;
116  extern const std::string WSPacketHandleError;
117  extern const std::string WSFlowControlError;
118  extern const std::string WSTransferToLoopbackError;
119  extern const std::string WSCreateLoopbackError;
120  extern const std::string WSLoopbackStackSizeError;
121 
122  // DataList errors:
123  extern const std::string DLNullRawNode;
124  extern const std::string DLInvalidNodeType;
125  extern const std::string DLGetNodeDataError;
126  extern const std::string DLSharedDataStore;
127  extern const std::string DLPushBackTypeError;
128 
129  // MArgument errors:
130  extern const std::string ArgumentCreateNull;
131  extern const std::string ArgumentAddNodeMArgument;
132 
133  // ProgressMonitor errors:
134  extern const std::string Aborted;
135 
136  // ManagedExpression errors:
137  extern const std::string ManagedExprInvalidID;
138  extern const std::string MLEDynamicTypeError;
139  extern const std::string MLENullInstance;
140 
141  // FileUtilities errors:
142  extern const std::string PathNotValidated;
143  extern const std::string InvalidOpenMode;
144  extern const std::string OpenFileFailed;
145  } // namespace ErrorName
146 
147 } // namespace LLU
148 
149 #endif // LLU_ERRORLOG_ERRORS_H
LLU::ErrorName::WSCreateLoopbackError
const std::string WSCreateLoopbackError
Could not create a new loopback link.
LLU::ErrorName::WSTestHeadError
const std::string WSTestHeadError
WSTestHead failed (wrong head or number of arguments)
LLU::ErrorName::ImageCloneError
const std::string ImageCloneError
MImage cloning failed.
LLU::ErrorName::RankError
const std::string RankError
same as LIBRARY_RANK_ERROR
LLU::ErrorName::DLInvalidNodeType
const std::string DLInvalidNodeType
DataStoreNode passed to Node wrapper carries data of invalid type.
LLU::ErrorName::MLENullInstance
const std::string MLENullInstance
Missing managed object for a valid ID.
LLU::ErrorName::Aborted
const std::string Aborted
Computation aborted by the user.
LLU::ErrorName::ImageNewError
const std::string ImageNewError
creating new MImage failed
LLU::ErrorName::SparseArrayImplicitValueError
const std::string SparseArrayImplicitValueError
could not read implicit value from MSparseArray
LLU::ErrorName::WSWrongSymbolForBool
const std::string WSWrongSymbolForBool
Tried to read something else than "True" or "False" as boolean.
LLU::ErrorName::FunctionError
const std::string FunctionError
same as LIBRARY_FUNCTION_ERROR
LLU::ErrorName::WSPutStringError
const std::string WSPutStringError
Could not send string via WSTP.
LLU
Main namespace of LibraryLink Utilities.
Definition: Queue.h:13
LLU::ErrorName::SparseArrayCloneError
const std::string SparseArrayCloneError
could not clone MSparseArray
LLU::ErrorName::WSNullWSLinkError
const std::string WSNullWSLinkError
Trying to create WSStream with NULL WSLINK.
LLU::ErrorName::VersionError
const std::string VersionError
same as LIBRARY_VERSION_ERROR
LLU::ErrorName::SparseArrayRowPointersError
const std::string SparseArrayRowPointersError
could not read row pointers from MSparseArray
LLU::ErrorName::TensorNewError
const std::string TensorNewError
creating new MTensor failed
LLU::ErrorName::WSLoopbackStackSizeError
const std::string WSLoopbackStackSizeError
Loopback stack size too small to perform desired action.
LLU::ErrorName::WSPutScalarError
const std::string WSPutScalarError
Could not send scalar via WSTP.
LLU::ErrorName::DimensionsError
const std::string DimensionsError
same as LIBRARY_DIMENSIONS_ERROR
LLU::ErrorName::DLNullRawNode
const std::string DLNullRawNode
DataStoreNode passed to Node wrapper was null.
LLU::ErrorName::MArgumentIndexError
const std::string MArgumentIndexError
wrong argument index
LLU::ErrorName::ErrorManagerThrowIdError
const std::string ErrorManagerThrowIdError
trying to throw exception with non-existent id
LLU::ErrorName::WSTransferToLoopbackError
const std::string WSTransferToLoopbackError
Something went wrong when transferring expressions from loopback link.
LLU::ErrorName::ImageTypeError
const std::string ImageTypeError
Image type mismatch.
LLU::ErrorName::WSGetSymbolError
const std::string WSGetSymbolError
WSGetSymbol failed.
LLU::ErrorName::MArgumentTensorError
const std::string MArgumentTensorError
error involving Tensor argument
LLU::ErrorName::MArrayElementIndexError
const std::string MArrayElementIndexError
attempting to access MArray element at invalid index
LLU::ErrorName::TensorSizeError
const std::string TensorSizeError
wrong assumption about Tensor size
LLU::ErrorName::SparseArrayExplicitValuesError
const std::string SparseArrayExplicitValuesError
could not read explicit values from MSparseArray
LLU::ErrorName::WSGetListError
const std::string WSGetListError
Could not get list from WSTP.
LLU::ErrorName::ImageIndexError
const std::string ImageIndexError
trying to access non-existing element
LLU::ErrorName::SparseArrayExplicitPositionsError
const std::string SparseArrayExplicitPositionsError
could not read explicit positions from MSparseArray
LLU::ErrorCode::FunctionError
constexpr int FunctionError
same as LIBRARY_FUNCTION_ERROR
Definition: Errors.h:21
LLU::ErrorName::NumericArraySizeError
const std::string NumericArraySizeError
wrong assumption about NumericArray size
LLU::ErrorName::NumericArrayNewError
const std::string NumericArrayNewError
creating new NumericArray failed
LLU::ErrorName::WSGetFunctionError
const std::string WSGetFunctionError
WSGetFunction failed.
LLU::ErrorName::NumericArrayConversionError
const std::string NumericArrayConversionError
conversion from NumericArray of different type failed
LLU::ErrorName::SparseArrayToTensorError
const std::string SparseArrayToTensorError
could not dump MSparseArray to MTensor
LLU::ErrorCode::VersionError
constexpr int VersionError
same as LIBRARY_VERSION_ERROR
Definition: Errors.h:20
LLU::ErrorName::WSFlowControlError
const std::string WSFlowControlError
One of the flow control functions failed.
LLU::ErrorName::NumericArrayTypeError
const std::string NumericArrayTypeError
NumericArray type mismatch.
LLU::ErrorName::NumericArrayCloneError
const std::string NumericArrayCloneError
NumericArray cloning failed.
LLU::ErrorName::CreateFromNullError
const std::string CreateFromNullError
attempting to create a generic container from nullptr
LLU::ErrorName::NoError
const std::string NoError
same as LIBRARY_NO_ERROR
LLU::ErrorName::NumericalError
const std::string NumericalError
same as LIBRARY_NUMERICAL_ERROR
LLU::ErrorName::OpenFileFailed
const std::string OpenFileFailed
Could not open file.
LLU::ErrorName::WSGetScalarError
const std::string WSGetScalarError
Could not get scalar from WSTP.
LLU::ErrorName::TensorCloneError
const std::string TensorCloneError
MTensor cloning failed.
LLU::ErrorName::TypeError
const std::string TypeError
same as LIBRARY_TYPE_ERROR
LLU::ErrorName::WSPutFunctionError
const std::string WSPutFunctionError
WSPutFunction failed.
LLU::ErrorName::MemoryError
const std::string MemoryError
same as LIBRARY_MEMORY_ERROR
LLU::ErrorName::DLPushBackTypeError
const std::string DLPushBackTypeError
Element to be added to the DataList has incorrect type.
LLU::ErrorName::SparseArrayColumnIndicesError
const std::string SparseArrayColumnIndicesError
could not read column indices from MSparseArray
LLU::ErrorName::SparseArrayImplicitValueResetError
const std::string SparseArrayImplicitValueResetError
could not reset the implicit value of MSparseArray
LLU::ErrorName::WSGetArrayError
const std::string WSGetArrayError
Could not get array from WSTP.
LLU::ErrorName::TensorTypeError
const std::string TensorTypeError
Tensor type mismatch.
LLU::ErrorCode::RankError
constexpr int RankError
same as LIBRARY_RANK_ERROR
Definition: Errors.h:25
LLU::ErrorName::WSPacketHandleError
const std::string WSPacketHandleError
One of the packet handling functions failed.
LLU::ErrorCode::NumericalError
constexpr int NumericalError
same as LIBRARY_NUMERICAL_ERROR
Definition: Errors.h:23
LLU::ErrorName::ErrorManagerCreateNameError
const std::string ErrorManagerCreateNameError
trying to register exception with already existing name
LLU::ErrorName::PathNotValidated
const std::string PathNotValidated
Given file path could not be validated under desired open mode.
LLU::ErrorCode::MemoryError
constexpr int MemoryError
same as LIBRARY_MEMORY_ERROR
Definition: Errors.h:22
LLU::ErrorCode::NoError
constexpr int NoError
same as LIBRARY_NO_ERROR
Definition: Errors.h:27
LLU::ErrorName::SparseArrayFromTensorError
const std::string SparseArrayFromTensorError
could not create MSparseArray from MTensor
LLU::ErrorName::MArgumentImageError
const std::string MArgumentImageError
error involving Image argument
LLU::ErrorCode::TypeError
constexpr int TypeError
same as LIBRARY_TYPE_ERROR
Definition: Errors.h:26
LLU::ErrorName::ArgumentAddNodeMArgument
const std::string ArgumentAddNodeMArgument
Trying to add DataStore Node of type MArgument (aka MType_Undef)
LLU::ErrorName::DLSharedDataStore
const std::string DLSharedDataStore
Trying to create a Shared DataStore. DataStore can only be passed as Automatic or Manual.
LLU::ErrorName::ManagedExprInvalidID
const std::string ManagedExprInvalidID
Given number is not an ID of any existing managed expression.
LLU::ErrorName::ImageSizeError
const std::string ImageSizeError
wrong assumption about Image size
LLU::ErrorName::WSPutArrayError
const std::string WSPutArrayError
Could not send array via WSTP.
LLU::ErrorName::InvalidOpenMode
const std::string InvalidOpenMode
Specified open mode is invalid.
LLU::ErrorName::MArgumentNumericArrayError
const std::string MArgumentNumericArrayError
error involving NumericArray argument
LLU::ErrorName::SparseArrayFromPositionsError
const std::string SparseArrayFromPositionsError
could not create MSparseArray from explicit positions
LLU::ErrorName::ErrorManagerThrowNameError
const std::string ErrorManagerThrowNameError
trying to throw exception with non-existent name
LLU::ErrorName::TensorIndexError
const std::string TensorIndexError
trying to access non-existing element
LLU::ErrorName::WSPutListError
const std::string WSPutListError
Could not send list via WSTP.
LLU::ErrorName::SparseArrayTypeError
const std::string SparseArrayTypeError
SparseArray type mismatch.
LLU::ErrorName::NumericArrayIndexError
const std::string NumericArrayIndexError
trying to access non-existing element
LLU::ErrorName::MLEDynamicTypeError
const std::string MLEDynamicTypeError
Invalid dynamic type requested for a Managed Library Expression.
LLU::ErrorName::DLGetNodeDataError
const std::string DLGetNodeDataError
DataStoreNode_getData failed.
LLU::ErrorName::MArrayDimensionIndexError
const std::string MArrayDimensionIndexError
attempting to access MArray dimension at invalid index
LLU::ErrorName::WSTestSymbolError
const std::string WSTestSymbolError
WSTestSymbol failed (different symbol on the link than expected)
LLU::ErrorName::ArgumentCreateNull
const std::string ArgumentCreateNull
Trying to create PrimitiveWrapper object from nullptr.
LLU::ErrorName::WSGetStringError
const std::string WSGetStringError
Could not get string from WSTP.
LLU::ErrorName::LibDataError
const std::string LibDataError
WolframLibraryData is not set.
LLU::ErrorName::WSPutSymbolError
const std::string WSPutSymbolError
WSPutSymbol failed.
LLU::ErrorCode::DimensionsError
constexpr int DimensionsError
same as LIBRARY_DIMENSIONS_ERROR
Definition: Errors.h:24