[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to clear Error handled by Application_Error()


I have the following code in a GUI application:

[code]
' Gambas class file

Static Public Sub Application_Error()

  Message.Error(Error.Text & "\n\nMust abort.", "Okay")
  Error.Clear
  Debug Error.Code, Error.Text

End

Public Sub Button1_Click()

  Message.Title = "Button 1"
  Error.Raise("oops1") 'Line 14

End
[/code]

Once the user is informed about the critical error, there is no need for it anymore. However, I can't figure out how to cancel the Error event. "Stop Event" doesn't do it. Error.Clear does clear the error code and text, but the application still stops due to the exception at Line 14.

I've found I can use Application_Log() for what I need, but for future reference, is it possible to stop an error event that is handled in Application_Error()?


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


Follow-Ups:
Re: How to clear Error handled by Application_Error()Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>