Questions tagged [error-trapping]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
95 views

Strange effect in the SphericalPlot3D [closed]

I found something odd in Mathematica when using the SphericalPlot3D command. Ranges for $x,y∈[0,2 \pi]$ are the same. All I do is swap sine and cosine. But when I ...
dtn's user avatar
  • 2,364
2 votes
0 answers
72 views

How to catch this error from TeXForm? TeXForm::unspt

I get lots of error from using TeXForm in 12.3.1 on some solutions that contain DifferentialRoot written in the new ...
Nasser's user avatar
  • 137k
4 votes
0 answers
70 views

On auto-limiting memory and other resource usage

I play fast and loose with my evaluations, so try to calculate something much too large at least once a day. Life has gotten a lot easier ever since I started setting: ...
Trev's user avatar
  • 763
0 votes
0 answers
110 views

fixing the error: " The current computation was aborted because there was insufficient memory available to complete the computation. " in mathematica

...
Aya's user avatar
  • 69
3 votes
1 answer
147 views

How does MMA return an unevaluated expression on errors without going into an infinite loop? [duplicate]

Post-answer note: this question is (understandably) marked as a duplicate, and indeed has a similar solution, but is subtly different in focus: the linked question is about returning a function call ...
thorimur's user avatar
  • 8,950
0 votes
0 answers
30 views

How to copy a number from an error message? [duplicate]

Is there any way to copy a number from an error message and assign it to a variable, without manually doing it? For instance, I am trying to solve some coupled Differential equations as follows: ...
surujjd's user avatar
  • 83
0 votes
0 answers
56 views

Use Check in a While loop without wasting the calculation

I am trying to generate and solve a matrix that tends towards being singular using variable arbitrary precision to ensure accuracy. Consider, for example, a matrix with tunable singularity: ...
Eli Lansey's user avatar
  • 7,429
0 votes
0 answers
32 views

After any execution temporary error comes out ,How to fix error in temporary directory

how can I repair this error that started to come out of nowhere, I have not made any changes in the equipment but mathematica accuses that error ...
BeTDa's user avatar
  • 480
3 votes
1 answer
65 views

How to handle numerical exception within a compiled function

I'm trying to evaluate a series of expressions, which, given a set of parameters, may be complex. Instead of throwing a CompiledFunction::cfn, I'm trying to catch ...
arax's user avatar
  • 1,831
0 votes
1 answer
66 views

Avoid an Error Message when Importing

Consider the following code Button["Import", file = SystemDialogInput["FileOpen"]; data = Import[file], Method -> "Queued"] which yields a button which, ...
sam wolfe's user avatar
  • 4,167
7 votes
3 answers
2k views

How to implement try/catch/end try in Mathematica in the most simple way?

There are lots of question/answers about exception handling in Mathematica. I still find exception handling in Mathematica too complicated to work with. I find Maple much simpler and easier to ...
Nasser's user avatar
  • 137k
6 votes
2 answers
168 views

How to Quiet[] only the first argument of Check[]?

I have a Check of the form Check[expr,failexpr, {NIntegrate::slwcon}] If expr throws slwcon, I would like to redo the calculation with higher precision by ...
doublefelix's user avatar
3 votes
1 answer
194 views

any way to stop all the following evaluations?

I often slect the whole notebook to evaluate. Sometimes some functions may return wrong parameters, which may happen, for example, I may have forgotten to specify values to some variables in the ...
larry's user avatar
  • 695
2 votes
1 answer
47 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 ...
Jmeeks29ig's user avatar
  • 1,427
2 votes
0 answers
433 views

How to handle exceptions and failures in Mathematica?

In python I can write fallback values like: ...
user305883's user avatar
11 votes
2 answers
413 views

Strange behaviour of Check

...
Ali Hashmi's user avatar
  • 8,900
5 votes
1 answer
268 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 ...
infinitezero's user avatar
  • 1,357
1 vote
0 answers
24 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: ...
Ofek Peretz's user avatar
2 votes
0 answers
106 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: ...
Jmeeks29ig's user avatar
  • 1,427
2 votes
0 answers
120 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 ...
Dropped Bass's user avatar
2 votes
2 answers
54 views

How to find all Solve::error_names? Or How to Check 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 ...
Nasser's user avatar
  • 137k
1 vote
1 answer
286 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: ...
cyrille.piatecki's user avatar
0 votes
0 answers
75 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 ...
Igor Rivin's user avatar
  • 5,064
6 votes
0 answers
158 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......
murray's user avatar
  • 11.8k
5 votes
1 answer
717 views

Stopping NDSolver at time of error

I am using NDSolver and WhenEvent to solve a system of differential equations. I get this message: ...
Andrea's user avatar
  • 548
2 votes
1 answer
432 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 ...
thecommexokid's user avatar
8 votes
2 answers
627 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 ...
QuantumDot's user avatar
  • 19.5k
2 votes
0 answers
136 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 ...
lara's user avatar
  • 978
9 votes
3 answers
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... ...
kjo's user avatar
  • 11.7k
4 votes
1 answer
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 ...
Pankaj Sejwal's user avatar
2 votes
1 answer
820 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 ...
twhoward99's user avatar
5 votes
1 answer
270 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: ...
Jens's user avatar
  • 96.8k
3 votes
1 answer
387 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 ...
Andrew's user avatar
  • 10.4k
5 votes
1 answer
128 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. ...
The-Ever-Kid's user avatar
  • 1,089
14 votes
1 answer
396 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 ...
rcollyer's user avatar
  • 33.8k
28 votes
1 answer
5k 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 ...
magma's user avatar
  • 5,280