Exception Handling

BlitzMax Forums/BlitzMax Programming/Exception Handling

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.

@grable: The Throw method accept ANY object, so the only safe way to get any exception is using the reflection based example.
You can even do:
Throw New TList


So the only way to handle ANY possible exception is:
Catch ex:Object
	Local ExceptionType:String = TTypeId.ForObject(ex).Name()
	Local ExceptionMessage:String = ex.ToString()
	

Your example will leave any exception different from TStreamReadException and TStreamWriteException unhandled.