473,748 Members | 7,590 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

N-tier Error handling best practices question

1 New Member
Hey guys,

I am writing an application where I want to follow the best practices on error handling.

This is what I have:

I created an enum for various issues that could happen within the DAL... INSERTFAILED, INSERTSUCCESSFU L etc... I am setting this enum to a property of the dal for the object to access after the dal is done with whatever method I call... get, getAll, update, insert, delete, etc...

The object can then access the property of the dal to get the exception message that was last thrown along with the enum value I set after I try catch finally in each method...

However, is this the best way to handle errors in n-tier design? What would be the best way to handle the SQL/XML/whatever error I may get in the dal and pass it up to the business object and then to the presentation layer?

Thanks guys!

Josh Fink
Dec 4 '07 #1
0 1251

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3021
by: Woody | last post by:
I am looking for some examples of how to manage DDL scripts among various versions of a production db and development and testing. I have tried a few things in the past, and it always gets very muddled and cumbersome. I need to be able to build any version of the database from scratch, BUT I also need to maintain an upgrade path from any version to any later version. So it is not enough to just maintain a master build script, but I...
3
1637
by: Sasha | last post by:
Hi everybody, I would like to hear your thoughts on the following problem. We have the following classes. Class Exam int ID* int Version* string Name
2
342
by: Aadam | last post by:
Does Microsoft have a best practices for tracking errors? (like in a database, what info, etc)
2
3488
by: cody | last post by:
Is this good style? I always have to catch the generic System.Exception because our system supports nested transactions that is BeginTransaction increases the level, Commit decreases it, rollback sets it to zero, and only if the level reaches zero the commit/rollback statement is sended to the database. try { BeginTransaction(); // stuff
13
6610
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
3
1297
by: Derek Martin | last post by:
Hi list, I have been doing VB.Net for quite a while now and just now getting into the forray of ASP.Net using VS2003. I have created our development website and now we are ready to start putting it into production. I've messed around with a few different deployment scenarios but the one we ended up with was two copies of the code, one on dev and one on prod and all changes we make to code on dev have to be copied to the prod and then...
4
2001
by: Sandy | last post by:
Hello - I read an interesting article on the web wherein the author states he doesn't handle too many errors at page level, but handles them at the application level. He further goes on to show how error logging can be incorporated using a Sql Server log with an additional text log in case Sql Server was down. My inclination after reading the article is to use Try-Catch-Finally as little as possible (tends to slow things if you have...
10
3478
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read somewhere that each folder under the "web site" is compiled in separate assembly. I however, did not find that the "web site" creation in vs.net 2005 created any AssemblyInfo.cs file.
7
1744
by: Rhino | last post by:
I thought I'd take a second to step away from a specific problem and ask a general question about best practices; I know some of the people here are very experienced with CSS. Given the need to have different CSS for printing than for screens, which of these two options is the best approach? 1. Have a single CSS for each media, then use different <link> tags for each media? 2. Have one CSS that includes all rules and use @media rules to...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.