Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While executing code it is normal to get the messages like shdw,argx etc. I wanted to know if there is anyway i can store all these messages into a array or a variable so that i can pinpoint where the error occurred.

The scenario is that i have written few functions in webmathematica and deployed the files on the server. So in future if there are any issues with those functions i want to use the errors(messages) and convert these errors into diff user defined http requests(in turn used to send a mail containing these messages).

share|improve this question
You can use $MessageList. I don't know if it works in webMathematica or how to use it in wM. – R. M. Oct 8 '13 at 13:19

In webMathematica there is already MSPGetMessage[] So if you do something like

mess = MSPGetMessages[];

you have a list of messages. E.g., if you had an error for

"1\nPower::infy: Infinite expression - encountered.\n 0"

Notice that $MessageList gives just

share|improve this answer
thanks for the answer. How do i use this mess = MSPGetMessages[]; what i intend to ask is that i have a package that has 4 to 5 functions. so i am aiming at capturing error for every function in the package. these functions are called in another package(lets call it evaluation). When i run evaluation package and if there are any errors in these functions the evaluation should stop and i should be able to use these messages to generate http – shiva Oct 9 '13 at 5:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.