Rank: Newbie Groups: Member
Joined: 5/14/2014 Posts: 8
|
I am receiving a runtime exception. It doesn't cause my application to stop working. It is more of an annoyance than an actual problem so I would like to "silence this message" as the message box describes. The message says "You can handle EO.Base.Runtime.Exception event to silence this message box."
I've searched the forums and cannot find a code sample that shows how to handle the EO.Base.Runtime.Exception event. Can you please provide me with a code sample? VB.Net would be preferred but C# will do if that is all you have.
Thank you
Edit:
I found the C# code in another thread (https://www.essentialobjects.com/forum/postst10473_Handling-EOWeb-exception.aspx)
Can you provide the code in VB.Net? Also, where do I put the bolded line. My application is a windows forms application.
EO.Base.Runtime.Exception += new EO.Base.ExceptionEventHandler(your_handler);
void your_exception_event_handler(object sender, EO.Base.ExceptionEventArgs e) { //do whatever you want here..... }
|
Rank: Newbie Groups: Member
Joined: 5/14/2014 Posts: 8
|
I was able to figure out the equivalent code in VB.Net:
' Add handler to capture EO.Base.Runtime.Exceptions AddHandler EO.Base.Runtime.Exception, AddressOf Me.EOBaseRuntime_Exception_Handler
Then I added the handler itself:
Private Sub EOBaseRuntime_Exception_Handler(ByVal sender As Object, ByVal e As EO.Base.ExceptionEventArgs) Try ' Do stuff here Catch ex As Exception
End Try End Sub
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Great. Glad that you got it working!
|