I am inserting data into server using SQLInsert
. I want to store the error messages i encounter when data is not inserted. Apparently the error output is different from function output how do i store the error output rather than the function output $Failed
.
1 Answer
$\begingroup$
$\endgroup$
1
To make my comment above more concrete, question 134698 gives the basic process for capturing the error messages as strings. For instance, the two error messages from
NDSolve[k y[x] + (y''[x] == 0, y, x]
can be captured by
t = "MessagesText" /. EvaluationData[NDSolve[k y[x] + (y''[x] == 0, y, x]];
t
(* {"NDSolve::ndlim : Range specification x is not of the form {x, xend} or
{x, xmin, xmax}.",
"NDSolve::ndnco : The number of constraints (0) (initial conditions) is not equal to
the total differential order of the system plus the number of discrete
variables (2)."} *)
-
$\begingroup$ Thank you, it works for my case as well. $\endgroup$ Commented Jun 30, 2017 at 6:56
$MessageList
orMessageList
any use to you? $\endgroup$JDBC::error: Conversion failed when converting date and/or time from character string
. WhileMessageList[-1]
produces{JDBC::error}
and$MessageList
gives{}
. So nope. $\endgroup$