Questions about coding the generation of Messages and about the Message subsystem itself.

learn more… | top users | synonyms (2)

10
votes
2answers
236 views

Checking the argument of user-defined function with side-effect method

Today, I answered a question of mine that asked two month ago. Please see here Now I would like to add the argument checking in this function. Then I used a method that Mr.Wizard answered ...
6
votes
1answer
44 views

How can I see more of the Java stack trace when an exception occurs in JLink?

If I call into Java code via JLink`, and there is an uncaught exception, Mathematica produces a Java::excptn message, and prints ...
4
votes
1answer
131 views

How to check the option value?

Given that I have a function func as follow: To check the value of options, I using the step-by-step method If[] ...
1
vote
0answers
26 views

Messages muted in standalone CDF files

In Mathematica, when you call a function, messages may be generated and shown in a pink Messages window: These messages are shown also for CDF files when you open them with Mathematica. I have ...
8
votes
5answers
346 views

How to check the style and number of arguments like the built-in functions?

Given that I have a function sqrt[x] that I must check the style and number of argument x. I can do like this: ...
7
votes
1answer
55 views

How to properly generate messages from LibraryLink function?

I'm currently using WolframLibraryData::Message to generate messages from a library function, like this: ...
3
votes
1answer
91 views

Handling error in WSTP program C/C++

I have a program, written in C++, which uses WSTP to communicate with Mathematica 10 (i.e., linked using Install["name_program"]). How should my code report an ...
14
votes
2answers
370 views

Messages leak out from Block

fixed in 10.1 When assigning message to a symbol localized by Block, I would expect that this message is not accessible outside of ...
7
votes
1answer
137 views

How to use Message with an error string without predefining it first?

I need a very simple error reporting using Message. But I do not want to pre-define each error message separately as shown What are the best practices / most common / idiomatic ways to report errors ...
3
votes
2answers
91 views

How restore printing of messages?

In the upper left hand corner of my message window, the button reads "Delete all messages". I don't get any messages at all. How can I get messages restored.
0
votes
1answer
37 views

Off[FinancialData::notent] fails on first run but works thereafter

Off[FinancialData::notent] fails on first run but works thereafter. So what good is it in this case? Is there a trick to force first time success? I've tried ...
9
votes
2answers
97 views

Detect Messages within an expression without losing the return value?

I know that Check[expr,failexpr] is a mechanism to catch messages. The problem with it is that if a message is generated within ...
7
votes
2answers
194 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 ...
3
votes
0answers
47 views

ScheduledTask output redirection

When a function is run repeatedly within a ScheduledTask its output is sent to Messages Window. When two or more ScheduledTasks are running their outputs are mixed in the Messages Window and this is ...
5
votes
0answers
57 views

Is “MaxMessageCount” broken or is its function counter-intuitive?

Behavior remains unchanged through Mathematica version 10.1.0 As noted by kguler the Front End option: MessageOptions -> "MaxMessageCount" does not appear to ...
2
votes
1answer
163 views

Disable alert message with internet connectivity off

I work in an environment that has mathematica's internet connectivity turned off under Help > Internet Connectivity. Recently, after installing mathematica 10.0, every time mathematica is loaded it ...
11
votes
3answers
114 views

How to limit number of user-defined messages issued per evaluation

I have written code such that if it runs into a particular function, a warning message is issued. However, it is common for the program to call this function several times in a single evaluation, but ...
5
votes
4answers
135 views

Passing a variable messages list to Quiet

I'm trying to build a Verbose option into some code but I'm having trouble passing to a Quiet statement a variable list of which messages I want to suppress. My ...
7
votes
1answer
66 views

Issuing user-defined messages takes a long time (Message is slow)

Issuing messages takes a very long time in version 9 and version 10. Can others reproduce this? Is there a fix? Update: This is slow only when using the front end, but not when running the kernel ...
7
votes
2answers
321 views

How to switch off all messages?

How can I want to switch off all messages in a Mathematica session? Quiet[expr] allows me to evaluate expr without messages. ...
3
votes
3answers
519 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... ...
0
votes
2answers
99 views

Cases Message Valid Notebook Structure

Note: Spelunking will likely be needed. Execute the following. You should get back and error along the lines of First::first:... This error is unimportant except ...
7
votes
1answer
469 views

How to switch off messages on all kernels?

I am using ParallelMap for my code,however, it gives some messages that don't affect the evaluation process but fill up the memory and take some more time. So, I ...
4
votes
0answers
113 views

How can you link Parallel Mapping and Error tracking

Following this question and the comments made, together with the information in this question, the following code allows error tracking and debugging very nicely. ...
4
votes
1answer
210 views

warnings shows up in message window

I have no idea why, but suddenly all my evaluation with warnings like "sum does not converge" has begun to show up in a message box. Since always they appeared between In[] and Out[]? How do I make ...
19
votes
3answers
752 views

How to program a F::argx message?

How useful is it to program a user-built function in a package to produce a red warning message F::argx if you give the wrong number of arguments to that function? ...
16
votes
1answer
214 views

Standard message definition construct

Why are the messages almost always defined like this (at least in packages): If[Not@ValueQ[function::usage], function::usage = "Usage message"] and not just like ...
8
votes
2answers
139 views

Attaching the same message to several symbols

It is common in many packages, as well as system symbols, that the same message can be issued by several functions. Here's an example: One mechanism that can be used for this is to define the ...
12
votes
4answers
556 views

How to catch complete error message information

If I evaluate this expression: Module[{}, 1/0;0^0]; msg = $MessageList I get: ...
15
votes
1answer
528 views

Quiet doesn't work with FindRoot when using Brent method

The following has no solution: FindRoot[x == 1, {x, 0.25, 0, 0.5}] And Mathematica correctly warns us: FindRoot::reged: The point {0.5} is at the edge of the ...
9
votes
1answer
163 views

Retrieving the text of a message

Is there a simple, built-in way to retrieve the text of a message, given it's identifier (such as Power::infy)? The documentation describes how ...
10
votes
2answers
300 views

How to find a specific error message?

Is there a way to find an existing error message in the System` context, that is used for a certain case? I want to include a message in a custom function that ...
4
votes
1answer
140 views

Dealing with errors and resuming the code after one

How can I write my Mathematica code so that it resumes at a specific place if any Message is displayed during the execution of an expression? For example, in Visual ...
10
votes
1answer
1k views

NIntegrate error bound

I am trying to evaluate a highly oscillatory integral using NIntegrate. I fear that due to limited resources (time and/or memory), I will not be able to evaluate the integral to the desired precision. ...
18
votes
2answers
3k views

How do I work with Root objects?

I want to solve the trigonometric equation : $$(3-\cos 4x )\cdot (\sin x - \cos x ) = 2.$$ I tried Solve[(3 - Cos[4*x])*(Sin[x] - Cos[x]) == 2, x] It returns the ...
8
votes
1answer
115 views

What is the simplest way to determine which call to a superfunction has generated a Message?

I have a complicated function which contains many calls to NIntegrate, NSolve, FindRoot and ...
25
votes
3answers
815 views

Prepend Information to Warning Messages

I have a function running within a Do loop that sometimes issues a warning. I'd like to prepend the warning with the loop ctr so that I can go back and debug that instance later. Basically, I would ...
5
votes
1answer
4k views

What does “Tag Integer is Protected” message mean?

(Newbie question) For every function I define I get this message: When I close and reopen Mathematica, and re-enter the function definition, I don't get the message anymore. What does it mean?
3
votes
2answers
104 views

Is there a way to localize Off[some::message]?

Is there a way to temporarily suppress certain messages, so that I could write for example (with made-up syntax for that feature): ...
11
votes
1answer
306 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 ...
18
votes
2answers
4k views

Can Reduce *really* not solve for x here?

Sometimes I get the feeling I'm just flailing blindly with Mathematica. Is solving for $x$ in the equation $$ \frac{\cosh (x/2)}{x} = \sqrt{2} $$ really beyond the scope of Mathematica? I try to ...
17
votes
3answers
271 views

Is there any way to allow a message to appear more than three times before General::stop shuts it off?

I have some Mathematica code that analyzes data in a database and uses Message to report when expected data is missing. By default, Mathematica will allow this ...
43
votes
2answers
2k views

Mathematica Debuggability

One of the things that I really dislike about Mathematica is its lack of debuggability compared to many other programming languages. Some of the problems arises from the functional nature of ...
39
votes
5answers
2k views

How to abort on any message generated?

Mathematica is a bit unusual as a programming language because it never stops on messages, regardless of whether the message is an error, a warning or just an informative message. It simply prints the ...
4
votes
1answer
753 views

Why these (error) messages?

Testing this answer I used: stream = OpenWrite["A:\\out.txt"]; Block[{$Messages = stream}, Mod[1, 2, 3, 4, 5] ] and I was surprised to find that the contents ...
31
votes
1answer
526 views

which is better, using Assert[] or manual checks on arguments and other computations?

I never used Asserts in Mathematica, but trying to see what advantage they have over just argument check and additional definitions of the function to capture unwanted input. For example, which one ...
54
votes
2answers
2k views

What are the best practices / most common / idiomatic ways to report errors in Mathematica?

In particular, what are the best ways to report errors about incorrect arguments to a function? Checking for the correct arguments is relatively easy using patterns, but how to report an informative ...