RosettaCodeData/Task/Exceptions/PureBasic/exceptions.basic

10 lines
323 B
Text
Raw Normal View History

2023-07-01 11:58:00 -04:00
Procedure ErrorHandler()
MessageRequester("Exception test", "The following error happened: " + ErrorMessage())
EndProcedure
MessageRequester("Exception test", "Test start")
OnErrorCall(@ErrorHandler())
RaiseError(#PB_OnError_InvalidMemory) ;a custom error# can also be used here depending on the OS being compiled for