Is there a setting (I’d expect it to be an environment variable) in Mathematica that would make the kernel quit at the occurrence of a debug error? Often, I’ll get debug errors and the notebook will continue evaluating bad data forcing me to restart the kernel.
Share
You wrote:
You can do this by defining
$AssertFunctionas follows:Now the kernel quits when an assertion fails:
Alternatively, you can use
Interruptin the same way:It allows you to abort the evaluation or enter subsession (the same as
Dialog[]does in Arnoud’s answer).You also can extend this approach for printing the assertion which failed: