How to catch all exceptions?
- From: "K Viltersten" <tmp1@xxxxxxxxxxxxxx>
- Date: Tue, 23 Sep 2008 07:11:35 +0200
I've developed a service and protected it's
contents from presenting the potential error
messages by a number of try-catch statements,
especially a general, top level try-catch.
When i run it, i sometimes get errors to the
screen anyway, which depends (i suspect) on
the fact that i execute external EXE's. How
can i make perfectly sure not to show
anything to the screen but report all
exceptions back to the try-catch so i can
log them? I've done the following.
public void RunMe(){
Process process = null;
try{
process = new Process();
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.FileName = "c:\javaws.exe";
process.StartInfo.Arguments = options;
process.Start();
}
catch (Exception exception){
Logger.WriteLog(exception.Message);
}
}
Is it possible? What have i missed?
--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.
.
- Follow-Ups:
- Re: How to catch all exceptions?
- From: K Viltersten
- Re: How to catch all exceptions?
- Prev by Date: Re: Even And Deligate
- Next by Date: Re: SmtpClient class alternative?
- Previous by thread: Even And Deligate
- Next by thread: Re: How to catch all exceptions?
- Index(es):
Relevant Pages
|