Welcome Guest Search | Active Topics | Sign In | Register

Code sample for handling the EO.Base.Exception event Options
Michael George
Posted: Wednesday, October 25, 2017 11:59:37 AM
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.....
}
Michael George
Posted: Wednesday, October 25, 2017 2:28:17 PM
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


eo_support
Posted: Wednesday, October 25, 2017 4:42:25 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Great. Glad that you got it working!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.