|
-
Mar 1st, 2005, 02:53 PM
#1
Thread Starter
Frenzied Member
Exception management in multi tier web apps
I have adesigned quite a few asp.net apps, all working almost identically.
I start off with 3 tiers
Data (Class library)
Business(Class library)
Presentation (asp.net or winforms)
I suspect many other asp.net devs design their code in perhaps the same way, or in even more tiers, if you adhere to the SOA architecture.
What im curious to know is that how do you handle exceptions in your asp.net apps, and how do you display information to the user? Do you use custom exceptions? Where in the tiered design do you log the exceptions?
I use this design:
Datatier:
try
...here i create db object, make query
catch
throw
finally
...close db connection dispose db object
Businesstier:
try
...I call my shared datatier method and returns either datareader or dataset
catch
throw new applicationexception("An error occured when trying to save the user",ex)
...I wrap the exception and deliver a text message to the user including the inner exception
presentationtier:
try
...some action like pressing a button
catch
logexception(ex) <--i use the logging component to log the exception and all its inner ones
showmessagebox(ex.message) <----javascript messagebox
There you have it... what do you think of this design? Should I perhaps log the exception in the business tier?
How do you other pros write your exception management architecture?
kind regards
Henrik
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|