I usually keep my notebooks collapsed to make understanding what's going on easier. The problem is that if there's an execution error, I have to expand everything in order to even know that there was an error. I'm looking for a solution to this.

Some years ago I posted this question (Show error messages from collapsed sections), and now if I try that solution my code hangs. There have probably been a lot of changes since then.

For now, if I could just send execution errors to the message window (or anywhere else) and also keep them in line with the code, my problem would be solved. I couldn't figure out from the documentation how to send all errors to the message window.

Alternatively if someone could tell me how to search my notebook for errors, that would also solve my problem.

As an aside, I didn't know how to best create the html link in this post. I'd appreciate advice or an edit.

  • 2
    $\begingroup$ SetOptions[ $FrontEnd, MessageOptions -> {"ErrorAction" -> "PrintToConsole", "KernelMessageAction" -> "PrintToConsole"}, PrintAction -> "PrintToConsole" ]; sends all KernelMessages to the Messages window (I always wondered why the Messages window is the same as a console, but well, who cares). I don't know how to send messages to more than one place. $\endgroup$ – Rolf Mertig Nov 27 '18 at 18:06
  • $\begingroup$ You might be able to use a message handler to duplicate messages to the console - you could even add information about the currently evaluating line to make it easier to find the cause $\endgroup$ – Lukas Lang Nov 27 '18 at 20:41
  • $\begingroup$ @RolfMertig is there a way to print that message window to the command line if you were to write using wolframscript? $\endgroup$ – BOUNCE May 24 '19 at 16:13
  • 1
    $\begingroup$ @hoodedarcher I dont know. It should just work by default, since "PrintToConsole" should print to the console, i.e. terminal on MacOSX or Linux, if the FrontEnd is used in the background from wolframscript. $\endgroup$ – Rolf Mertig May 24 '19 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.