Questions tagged [error-trapping]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

Query about the error “$RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of Join[r1,{4.23309*10^-14}].”

I have written a function DirectSmoothCubicFit for a particular application. I am using this function to store some values in a list using a loop (I tried both For and Do loop). But the mathematica ...
2
votes
1answer
35 views

How can I properly use Catch[] to prevent my program from quitting?

I am getting an error depicting an Uncaught Throw, with the accompanying code being returned: Hold[Throw[$Failed, CURLLink`Utilities`Exception]] I have managed ...
0
votes
0answers
46 views

How to handle exceptions and failures in Mathematica?

In python I can write fallback values like: ...
11
votes
2answers
399 views

Strange behaviour of Check

...
5
votes
1answer
118 views

Raise Warning/Error on invalid Matrix Addition and Multiplication

Consider the following code: DiagonalMatrix[{1, 1, 1}] - 1 Mathematica interprets it in the way, that it substracts 1 from every matrix field while ...
1
vote
0answers
19 views

How to get a value from Error message? [duplicate]

I've looked pretty hard for a solution to this issue with no luck. Hope you could give me a clue: When I run NDSolve I get the following error msg: ...
2
votes
0answers
52 views

How can I deal with a SystemException?

I have a list of functions that are being evaluated, using ParallelTable[], and continue to get the error message: ...
2
votes
0answers
87 views

What is a way to handle “QuadraticProgramming” method for FindMinimum crashing the kernel?

I need to solve about a million of QP problems, each having about N=2000 variables with N-2 inequality constraints and 2 equality constraints. Trying to use the "InteriorPoint" method freezes my ...
1
vote
2answers
31 views

How to find all Solve::error_names? Or How to Catch all except one specific error?

Basically, all what I want is to use Solve and detect when it can't solve the equation, except for the case when it throws Solve::ifun which will consider as OK and ...
0
votes
1answer
94 views

Catching and reacting to a warning [closed]

I have a program which can lead in certain cases to a division by zero. I would like to know if there is a way in Mathematica to make a conditional statement like the following one: ...
0
votes
0answers
60 views

FinancialData returns a Failure[] object

What is the recommended way to deal with this (basically, if I get "Failure", I would like to say that the data is missing, and I can obviously call the function inside another function, check if the ...
6
votes
0answers
130 views

How trap expression that doesn't evaluate?

If evaluating an expression produces an error, it's easy to trap that using Check or Throw......
3
votes
1answer
453 views

Stopping NDSolver at time of error

I am using NDSolver and WhenEvent to solve a system of differential equations. I get this message: ...
2
votes
1answer
237 views

FindRoot over a domain, but give domain boundary if no root exists

I call r = x /. FindRoot[f[x] == 0, {x, 0, -5, 5}] f[x] is always monotonic, but sometimes it doesn't have a root in the ...
7
votes
2answers
501 views

Catching error in middle of evaluation of compiled function

I have programmed and Compileed a complicated numerical function. The function has singularities (i.e. are infinite) at certain input numerical values. I need to ...
2
votes
0answers
86 views

Is there a function similar to SQL's Iserror? [duplicate]

I have an output which I want to hide if there is an error otherwise display it. The output is a Dynamic[output] so I can't simply use something like ...
5
votes
3answers
2k views

Need help with exception handling

I have read the docs for Catch, Throw, and friends multiple times, and I confess that I find them utterly incomprehensible... ...
4
votes
1answer
1k views

Exception/Error handling using returns codes

There is good explanation available for error handling on this and similar links. Here there is information on handling inappropriate input arguments and handling unprocessed functions using ...
2
votes
1answer
673 views

Handling Overflow

I have a notebook which takes in a user-defined function and starting value and tracks the orbit of the particle under iteration of the function. The problem occurs when the user enters a starting ...
5
votes
1answer
246 views

Error invoking Information on functions containing Legended

Bug fixed in version 11 In adapting some plotting functions to utilize the PlotLegends option of version 9, I came across the following errors: ...
3
votes
1answer
320 views

Printing a success message if no errors have yet been thrown in the current session

I plan to run a lengthy Mathematica script on a Linux terminal (by "a Linux terminal," I mean that I have text output only -- no GUI), using the program math. To ...
5
votes
1answer
121 views

Strange Tilt on error notification

I was testing the source code of the answers to this question. And when I tried this response and maxed out most of the manipulators, this is what I got. What went wrong that the errors are tilted. ...
12
votes
1answer
363 views

Check does not interrupt evaluation of the expression when a Message is emitted

On the surface, Check looks like a good method to use when you need to abort the evaluation of an expression whenever a Message ...
23
votes
1answer
4k views

Error checking and trapping techniques with Throw and Catch

Mathematica provides several mechanisms for checking arguments and trapping errors in a function definition. Typical methods are : Definitions with argument patterns, definitions with ...