Error handling

G

Guest

Hello -

I have a Page_Load Sub that essentially just fills a couple of
dropdownlists. Is it recommended to wrap something of this nature in a
Try-Catch-Finally-End Try block?

Additionally, I have a few small subs that relate to paging datagrids. Is
it necessary to wrap this in error-handling code?
 
B

bradley

Errors handing should be implemented in those situations where you want an
alternative series of steps to be executed when the usual series of steps
throws an error. This is typically done for those steps that are dependent
on external factors and could potentially fail, but may succeed again given
more interaction by the user or just a small amount of time. For example,
programming which accesses the database are likely candidates. If the user
attempts to submit a form for a new invoice and the transaction fails due to
record locking, then you would want to re-direct them to a special page and
possibly try to cache the form data in a such a way that it could be
re-submitted by clicking the button again. However, if you have programming
that simply handles events or populates properties on a control, then there
is no reason for it to fail unless there is a programming bug, in which case
allowing the user to re-try would be useless.
 
E

Eliyahu Goldin

Sandy,

You handle errors in every place where you need to handle errors. You might
want to handle errors for various reasons. You might want to supply your own
customized errors messages. Or you might want to ignore some errors. There
are no general recommendations, everything depends on the application logic
and requirements.

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Error Handling 27
Best practice error handling? 12
Exception Handling 33
Error Handling 1
Error Handling 2
Error Handling 1
error handling in multithreaded extension callbacks 0
Another Question on Error Handling 0

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top