|
-
Feb 4th, 2004, 10:12 PM
#1
Thread Starter
New Member
how to create an instance of an exception?
Hi again!
I just want to know how to create an instance of an exception in my UI. Since all exceptions thrown by the web service are soap exception I can no longer get the real error that occur in the web service. My problem now is how can I know in what object did the error occured or what specifically is the exception.
I would really appreciate any help.
thanks!
byteArray
-
Feb 5th, 2004, 03:38 AM
#2
Sleep mode
Try to use Source method of the thrown exception obj .
PHP Code:
try
{
//Your code that errors out here
}
catch (Exception x)
{
MessageBox.Show("Error description " + x.Message +
" Error source " + x.Source );
}
-
Feb 5th, 2004, 04:02 AM
#3
Thread Starter
New Member
Thanks for the help.
I've already tried to catch different exceptions using the format u've suggested but still it can't get the exact exception that occured in the web service because in the client the exceptions that I get are soap exceptions. And the value of the souce is always "System.Web.Service".
-
Feb 5th, 2004, 04:24 AM
#4
Sleep mode
Umm , what does the error say ?
-
Feb 5th, 2004, 01:13 PM
#5
A shot in the dark really, but try
Code:
try {}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.InnerException.Source);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|