superservo15
Member
Hi All,
I'm having problems trying to "bubble" up a custom exception I made... And I'm pretty new to custome exceptions, I was just told to use it this way and figure out the implementation.
I have a custom exception class called "SystemIsBusyException"
In my data layer class I do a check to see if the system is busy (ie/ a status is set to a certain value). If it is, I want to throw my custom exception back to my business object, then in the business object, throw it back to my controller class, where the error will be handled on the UI.
My DLC looks like this
Then in my Business Object I also have a try catch like
When it hits either of the exception handlers, I get a "SystemIsBusyException was Unhandled" error with the message being
"Exception of type 'Reins.Annuity.SystemIsBusyException' was thrown."
I can't figure out how to bubble up my custom exception like we do with regular system and app exceptions and I can't figure out what I am missing to make it happen.
Any help is MUCH appreciated, thanks
I'm having problems trying to "bubble" up a custom exception I made... And I'm pretty new to custome exceptions, I was just told to use it this way and figure out the implementation.
I have a custom exception class called "SystemIsBusyException"
VB.NET:
Public Class SystemIsBusyException
Inherits System.Exception
Public Sub New()
MyBase.New()
End Sub
End Class
In my data layer class I do a check to see if the system is busy (ie/ a status is set to a certain value). If it is, I want to throw my custom exception back to my business object, then in the business object, throw it back to my controller class, where the error will be handled on the UI.
My DLC looks like this
VB.NET:
Try
If OurSystem.IsBusy Then
Throw New SystemIsBusyException()
End If
'DO DLC stuff
Catch ex As SystemIsBusyException
Throw ex
Catch ex As Exception
Throw ex
End Try
Then in my Business Object I also have a try catch like
VB.NET:
'Call DLC
Catch ex As SystemIsBusyException
Throw ex
Catch ex As Exception
Throw ex
End Try
When it hits either of the exception handlers, I get a "SystemIsBusyException was Unhandled" error with the message being
"Exception of type 'Reins.Annuity.SystemIsBusyException' was thrown."
I can't figure out how to bubble up my custom exception like we do with regular system and app exceptions and I can't figure out what I am missing to make it happen.
Any help is MUCH appreciated, thanks