PC Review


Reply
Thread Tools Rate Thread

displaying exception message from custom exception

 
 
bdgreen@pacbell.net
Guest
Posts: n/a
 
      18th Aug 2006
Hi,

I made a custom exception, derived from ApplicationException. If the
exception is thrown, the erroring web page shows the line of code where
I throw exception, and doesn't display the exception message. Do I
need to catch my custom exception, and rethrow it as another type of
exception to make the message display?

I still want to page to error out, I don't want to catch it and return
a user-friendly message or anything. The page needs to error so that
operations will know errors are being thrown.

Thanks

 
Reply With Quote
 
 
 
 
Groove
Guest
Posts: n/a
 
      18th Aug 2006
I asked the same question at 11:24 am and no response yet. Where is
everyone?

--



<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I made a custom exception, derived from ApplicationException. If the
> exception is thrown, the erroring web page shows the line of code where
> I throw exception, and doesn't display the exception message. Do I
> need to catch my custom exception, and rethrow it as another type of
> exception to make the message display?
>
> I still want to page to error out, I don't want to catch it and return
> a user-friendly message or anything. The page needs to error so that
> operations will know errors are being thrown.
>
> Thanks
>



 
Reply With Quote
 
sloan
Guest
Posts: n/a
 
      18th Aug 2006
see
http://www.aspnetresources.com/blog/...ion_class.aspx



What I do is this.. which isn't what you want.

try

{

// web page stuff

}

catch(Exception ex)
{
Response.Write (ex.Message);
// or this
/*
if(null!=ex.InnerExeption)
{
Response.Write(ex.InnerException.Message);
}
*/
}


Ok.. having said that.. then yeah. do this.

try
{
//web stuff
}

catch(MyNamespace.MyException mex)
{
throw new SuperFriendlyException("MyException was thrown, but I don't
want to show you its info");
}
catch(Exception ex)
{
throw new SuperFriendlyException("ex was thrown, but I don't want to
show you its info");
}

Something like that.

Note, MyException is not the same object as SuperFriendlyException



<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I made a custom exception, derived from ApplicationException. If the
> exception is thrown, the erroring web page shows the line of code where
> I throw exception, and doesn't display the exception message. Do I
> need to catch my custom exception, and rethrow it as another type of
> exception to make the message display?
>
> I still want to page to error out, I don't want to catch it and return
> a user-friendly message or anything. The page needs to error so that
> operations will know errors are being thrown.
>
> Thanks
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception of type 'System.Web.HttpUnhandledException' wasthrown.Exception has been thrown by the target of an invocation.System.WebSystem.Exception jobs Microsoft ASP .NET 1 16th Nov 2007 05:57 PM
The exception unknown software exception(0x0eedfade) occured in the application at location 0x7c812a5d. Raghu Windows XP General 0 4th Nov 2006 07:49 AM
the exception unknown software exception (0x0eedfade) occured in the application at location 0x7c81eb33 mohammed.haseeb@gmail.com Windows XP Internet Explorer 1 25th Jul 2006 10:53 PM
Exception page not displaying tshad Microsoft ASP .NET 0 8th Feb 2006 03:12 PM
Publish exception to Email in Exception Handling Exception Block =?Utf-8?B?ZW15?= Microsoft C# .NET 1 31st Mar 2005 12:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:23 AM.