Catching Error Messages

BlitzMax Forums/BlitzMax Programming/Catching Error Messages

Sean Doherty(Posted 2006) [#1]
Is there a way to get better information from an error message. In the following code, all I get is the error. Is there a way to capture the class name or the function or method that caused the crash?

Catch ex:Object
Print ex.ToString()   
End



Dreamora(Posted 2006) [#2]
Only if you throw them, so its up to you what error you send. I would even create own error types which are extended from the base one.

BM modules don't throw errors at all. They just have a return value of null or MAV ;-)


Sean Doherty(Posted 2006) [#3]
That means that I have to put try and catch inside a ton of functions. Right now, I am just catching the errors in the main application.