@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:
So the only way to handle ANY possible exception is:
Your example will leave any exception different from TStreamReadException and TStreamWriteException unhandled.
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.