ianhinder / Kranc

A Mathematica package for generating code for solving time dependent partial differential equations
http://kranccode.org
GNU General Public License v2.0
28 stars 10 forks source link

Abort on messages #116

Open ianhinder opened 9 years ago

ianhinder commented 9 years ago

When Mathematica detects a problem, for example bad input to a function, it generates a message and returns the input unevaluated. This usually leads to a cascade of errors and is unhelpful in a system such as Kranc. Instead, Kranc should cause these messages to become fatal errors which cause Kranc to abort. This is possible using AddHandler (http://mathematica.stackexchange.com/questions/1512/how-to-abort-on-any-message-generated/9242#9242) and is used in SimulationTools and the Kranc test system already.

One problem with aborting on all messages is that new versions of Mathematica sometimes deprecate functions and output a message when they are used. We should not abort on these messages.