How can I show a Runtime error?

BlitzMax Forums/BlitzMax Programming/How can I show a Runtime error?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Aha, it's OK I searched the modules and found TBlitzException which al the other are derived from and so made this code:

Try
   (New TApplication).Run
Catch  o:Object
   If TBlitzException(o) Then Notify TBlitzException(o).ToString()
End Try


This works well. In debug mode I get a proper error message but in non-debug mode it just says "unhandled memory exception" which is a bit of a shame, but better than just bombing.

This is good because I'm having an issue with OpenGL just bombing on another PC and so now I can wrap all the code with this general catch all, compile a debug version, and then see what's going on (I hope).

[edit]OK, tried this line after the notify line:
If TNullObjectException(o) Then Notify("Null Object")

In debug mode, the second notify is shown, but not in non-debug mode. I assume that debug mode must basically be able to show more detailed error messages due to the way the .exe is compiled - oh well.