TomSlayton
Programmer
Hi,
I am kind of new to vb.net development and am creating an n-tier application. I am trying get my error handling setup properly between the tiers. The tiers are logically separated w/in the application. In this example let’s say I am trying to return a decimal value to the view from a query against the database. What is the best way to return a message back through the tiers to the end user if there is an error?
Data Tier – Talks to the datasource
Some class has this function:
--------------------------------
Public Shared Function GetSomeValue() As Decimal
Try
X = SELECT Sum (Foo) FROM Bar
Return x
Catch
Throw
EndTry
End Function
Business Objects –
Some business class has this:
------------------------------------
Public Function ProductCost() AS Decimal
Try
Return DataSvc.GetSomeValue()
Catch
Throw
EndTry
End Function
View
----------------
Let's say I call the BizObj.ProductCost() method and an error occurs in the data tier or business logic tier. The function is setup to return decimal how can I return a string to the view with a friendly end-user message?
Thanks,
Tom
I am kind of new to vb.net development and am creating an n-tier application. I am trying get my error handling setup properly between the tiers. The tiers are logically separated w/in the application. In this example let’s say I am trying to return a decimal value to the view from a query against the database. What is the best way to return a message back through the tiers to the end user if there is an error?
Data Tier – Talks to the datasource
Some class has this function:
--------------------------------
Public Shared Function GetSomeValue() As Decimal
Try
X = SELECT Sum (Foo) FROM Bar
Return x
Catch
Throw
EndTry
End Function
Business Objects –
Some business class has this:
------------------------------------
Public Function ProductCost() AS Decimal
Try
Return DataSvc.GetSomeValue()
Catch
Throw
EndTry
End Function
View
----------------
Let's say I call the BizObj.ProductCost() method and an error occurs in the data tier or business logic tier. The function is setup to return decimal how can I return a string to the view with a friendly end-user message?
Thanks,
Tom