471,313 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

c# Error Handling

aaj
Hi all

I have an automated application, that runs in the middle of the night.

If certain 'non system' errors occur (things like malformed files, missing
files etc..), I send an automatic Email and write a record to the database.
This is handled in a class.

When these errors occur, once Emailed and written I want to just end the
App, simple as that.

My inital thought was to End the Application at the end of the error
handling class using Application.Exit or Environment Exit. this means I just
write the code once and thats it, the App stops dead!! But while reading up,
It seems to be bad practice.

Is a better way to set a flag within the Error handling class, work its way
up the chain and then exit in the form code. The only problem is, some of
the error handling is nested quite deeply and passing this back to the top
level form may get a bit messy.

Does anyone have any recommendations for best practices on dealing with this
type of error handling.

many thanks.

Andy



Jul 21 '05 #1
2 1915
aaj
Sorry, shuld have posted to c# group!!!
"aaj" <aa*@aaj.com> wrote in message
news:1117630805.ce016e077c2e8711853a2889b84c5d8e@t eranews...
Hi all

I have an automated application, that runs in the middle of the night.

If certain 'non system' errors occur (things like malformed files, missing
files etc..), I send an automatic Email and write a record to the
database. This is handled in a class.

When these errors occur, once Emailed and written I want to just end the
App, simple as that.

My inital thought was to End the Application at the end of the error
handling class using Application.Exit or Environment Exit. this means I
just write the code once and thats it, the App stops dead!! But while
reading up, It seems to be bad practice.

Is a better way to set a flag within the Error handling class, work its
way up the chain and then exit in the form code. The only problem is, some
of the error handling is nested quite deeply and passing this back to the
top level form may get a bit messy.

Does anyone have any recommendations for best practices on dealing with
this type of error handling.

many thanks.

Andy


Jul 21 '05 #2
aaj
Sorry, shuld have posted to c# group!!!
"aaj" <aa*@aaj.com> wrote in message
news:1117630805.ce016e077c2e8711853a2889b84c5d8e@t eranews...
Hi all

I have an automated application, that runs in the middle of the night.

If certain 'non system' errors occur (things like malformed files, missing
files etc..), I send an automatic Email and write a record to the
database. This is handled in a class.

When these errors occur, once Emailed and written I want to just end the
App, simple as that.

My inital thought was to End the Application at the end of the error
handling class using Application.Exit or Environment Exit. this means I
just write the code once and thats it, the App stops dead!! But while
reading up, It seems to be bad practice.

Is a better way to set a flag within the Error handling class, work its
way up the chain and then exit in the form code. The only problem is, some
of the error handling is nested quite deeply and passing this back to the
top level form may get a bit messy.

Does anyone have any recommendations for best practices on dealing with
this type of error handling.

many thanks.

Andy


Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Christian Christmann | last post: by
13 posts views Thread by Thelma Lubkin | last post: by
3 posts views Thread by Stefan Johansson | last post: by
reply views Thread by rosydwin | last post: by

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.