1

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).

shiva
  • 11
  • 1
  • You can use $MessageList. I don't know if it works in webMathematica or how to use it in wM. – rm -rf Oct 08 '13 at 13:19

1 Answers1

4

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/0
"1\nPower::infy: Infinite expression - encountered.\n 0"

Notice that $MessageList gives just

{HoldForm[Power::infy]}
Kuba
  • 136,707
  • 13
  • 279
  • 740
Rolf Mertig
  • 17,172
  • 1
  • 45
  • 76
  • 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 09 '13 at 05:28