473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Best way to bubble up error message from callee to caller?

Using C#.

I have a web form that creates a new class. The class gets records from a
database.

What's the best practice for error handling? Do you put a try/catch in the
form code that calls the class's function AND in the the class too? How do
you pass the error message from the class to the form to be displayed for
the user? The class can be used by multiple web pages.

In the class, do you catch the exception and throw it again for the caller
to get?

Or do you catch the exception in the class and return false as a failed
status to the caller and display an error message for a generic failure?

J.

Nov 18 '05 #1
0 961

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matthew Houseman | last post by:
All, What's the accepted best practice for persisting data? Commit by the PL/SQL or commit by the caller (C#, Java, VB, etc.). I believe that if the caller starts a transaction and calls...
10
by: Neil | last post by:
I need to get two values from a complex SQL statement which returns a single record and use those two values to update a single record in a table. In order to assign those two values to variables...
9
by: Eric Lilja | last post by:
Hello, I'm a novice C++ programmer and now I have the task of converting a number of C++ functions to C. Some of the functions I'm converting takes a parameter of type reference-to-std::string...
4
by: Tiza Naziri | last post by:
Hi, Can anybody explain to me why this error occurs (during execution in MVC++): Debug Error! Program: C:\..(my code name) Module: File i386\chkesp.c
8
by: Daniel Portal | last post by:
Hi there, I'm in 3-tier project and I'm thinking about having Try / Catch statements in each method, just in case you know! If the case is that I don't have a special treatment for the error in...
9
by: Csaba Gabor | last post by:
Inside a function, I'd like to know the call stack. By this I mean that I'd like to know the function that called this one, that one's caller and so on. So I thought to do: <script...
11
by: gilbert | last post by:
Hello! I am writing an application that would like to make use of a thread message queue, like the one provided in MFC. In MFC, the message poster calls the function PostThreadMessage. The...
7
by: VK | last post by:
I was getting this effect N times but each time I was in rush to just make it work, and later I coudn't recall anymore what was the original state I was working around. This time I nailed the...
2
by: tylersimon | last post by:
Hi, I am trying to write some javascript in which a method in a custom object calls a global function. Within this global function I wish to establish what the object was that called me. I can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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,...

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.