MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

When I Get[] a package - how can I tell where the error message came from?

This seems like it would be a fairly common scenario, but I can't
figure out the answer.  I load a package by going <<Foo.m and it
issues a Message from some error during evaluation somewhere in the
package.  How do I find out what expression caused the error?  Using
Trace seems like it would be a pain ? it's a large package and there
would be lots and lots of stuff I'm not interested in in the trace. I
tried TraceDialog[Get["Foo.m"], _Message] ? looking to stop on a form
with the head Message, but it didn't work (printed the message and did
not stop at a dialog).

The only two ideas I have are: 1) Use $MessagePrePrint to initiate a
Dialog, then use Stack.  This probably only works if the message
actually has a parameter expression.  2) Unprotect Message and replace
it with something more to my liking, e.g., something that calls

But surely there's a better way?

Thanks! -- Dave Bakin

  • Prev by Date: Re: Ask Mathematica to sub for a long expression
  • Next by Date: Using FindRoot in complex funtion
  • Previous by thread: Re: SubValues
  • Next by thread: Using FindRoot in complex funtion