Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > displaying exception message from custom exception

Reply
Thread Tools

displaying exception message from custom exception

 
 
bdgreen@pacbell.net
Guest
Posts: n/a
 
      08-18-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
 
      08-18-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) ups.com...
> 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
 
      08-18-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) ups.com...
> 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

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 ASP .Net 1 11-16-2007 05:57 PM
while executing my client program i get the exception javax.naming.LinkException: [Root exception is javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: remaining if plz anybody know how to solve this problem then mahesh Java 0 03-08-2007 12:26 PM
Displaying the message in ASP.Net application..... Cris Rock ASP .Net 4 02-12-2004 07:54 AM
Displaying Message Boxes Paul Johnson ASP .Net 5 01-02-2004 01:49 AM
Displaying server side message box Sanjay Kedare ASP .Net 0 08-22-2003 11:02 AM



Advertisments