16 std::string errorMsgPrefix, std::string errorMsgSuffix) {
18 throwError(errorFunc,errorIfAssertionFails,errorMsgPrefix,errorMsgSuffix);
28 void UserErrors::throwError(std::string errorFunc,
errorType error, std::string errorMsgPrefix,
29 std::string errorMsgSuffix) {
31 std::string errorMsg = errorMsgPrefix;
36 errorMsg +=
" cannot be ALL.";
break;
38 errorMsg +=
" can only be called in mode ";
break;
40 errorMsg +=
" can only be called in state ";
break;
42 errorMsg +=
" cannot be called in mode ";
break;
44 errorMsg +=
" cannot be called in state ";
break;
46 errorMsg +=
" cannot be both synaptically and compartmentally connected.";
break;
48 errorMsg +=
" connectCompartments is bidirectional: connecting same groups twice is illegal ";
break;
50 errorMsg +=
" cannot be identical.";
break;
52 errorMsg +=
" cannot be larger than ";
break;
54 errorMsg +=
" cannot be negative.";
break;
56 errorMsg +=
" cannot be NULL.";
break;
58 errorMsg +=
" cannot be positive.";
break;
60 errorMsg +=
" cannot not be off at this point.";
break;
62 errorMsg +=
" cannot be on at this point.";
break;
64 errorMsg +=
" cannot be set to ";
break;
66 errorMsg +=
" cannot be smaller than ";
break;
68 errorMsg +=
" cannot be of type UNKNOWN.";
break;
70 errorMsg +=
" cannot be zero.";
break;
72 errorMsg +=
" could not be created.";
break;
74 errorMsg +=
" could not be opened.";
break;
76 errorMsg +=
" could not be read.";
break;
78 errorMsg +=
" is deprecated.";
break;
80 errorMsg +=
" must be identical.";
break;
82 errorMsg +=
" must be larger than ";
break;
84 errorMsg +=
" must be negative.";
break;
86 errorMsg +=
" must be positive.";
break;
88 errorMsg +=
" must be off at this point.";
break;
90 errorMsg +=
" must be on at this point.";
break;
92 errorMsg +=
" must be in the range ";
break;
94 errorMsg +=
" must be set to ";
break;
96 errorMsg +=
" must be smaller than ";
break;
98 errorMsg +=
" must have the same sign.";
break;
100 errorMsg +=
" cannot be called after network has been run.";
break;
102 errorMsg +=
" is unknown.";
break;
104 errorMsg +=
" cannot be called on this neuron type.";
break;
107 errorMsg +=
". An unknown error has occurred.";
break;
109 errorMsg += errorMsgSuffix;
parameter cannot have smaller vaule than some vaule
parameters must be identical
#define CARLSIM_ERROR(where, what)
parameters cannot be identical
parameter cannot be of type UNKNOWN
function cannot be called in certain mode
errorType
an enum of all possible error codes
function cannot be called in certain state
function cannot be called because network has already bun run
parameter cannot have larger vaule than some vaule
some parameters must have the same sign
the specified group id is unknown
parameter cannot be set to
parameter must be in some range
parameter cannot have NULL value
static void assertTrue(bool statement, errorType errorIfAssertionFails, std::string errorFunc, std::string errorMsgPrefix="", std::string errorMsgSuffix="")
simple wrapper for assert statement
function cannot be applied to neuron type
parameter must be smaller than
parameter cannot have positive value (opposite to "must be", but includes zero)
parameter must be larger than
function can only be called in certain state
keyword ALL is not allowed for this variable
cannot be connected twice
cannot be both synaptically and compartmentally connected
parameter must have negative value
parameter must have positive value
function can only be called in certain mode
parameter cannot have negative value (opposite to "must be", but includes zero)