Catching exceptions but don't want to cast the type.
I have a try catch where I don't know all of the exceptions that can be
thrown (I'm calling a web service in the try) and what I would ideally like
to do is a catch all but then look at the type of exception that was thrown
and decide what to do there. Because I don't know what all can be thrown I
need to have sort of a generic exception where I can then say - what type is
it ? and then process accordingly. I don't want to do a (Execption ex)
because that will lose some information - or at least I think it will.
I've tried doing catch (object ex) and it won't let me. Object must be
derived from System.Exception.
TIA - Jeff.
.
Relevant Pages
- Re: SoapServerException
... Lists just fine, but throws an exception when calling GetListItems, is ... Microsoft.SharePoint.SoapServer.SoapServerException was thrown.] ... >> I'm trying to consume the GetAttachments of the Site Web Service, ... >> Message message, WebResponse response, Stream responseStream) ... (microsoft.public.sharepoint.portalserver.development) - SoapServerException
... I'm trying to consume the GetAttachments of the Site Web Service, ... getting an Microsoft.SharePoint.SoapServer.SoapServerException thrown. ... foreach (string str in strAttach) ... Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was ... (microsoft.public.sharepoint.portalserver.development) - Re: Assertion on Type conversion
... The author states that "if a method has specified some pre-condition then the failure of that condition is the responsibility of the ... depends on the caller's ability to check for conditions, and assure them to be correct, prior to the calling of the method. ... An overlooked exception that could be handled gracefully. ... Implement a method like "IsValid" to do a runtime check first if your concerned about the ArgumentException being thrown. ... (microsoft.public.dotnet.languages.csharp) - RE: Microsoft.XLANGs.RuntimeTypes.InvalidPropertyTypeException
... Trying to access a data property on a message for which it has not ... Yes the exception is of significant concern; it is a major user error. ... Any exception thrown could delay the cleanup of resources, ... System.Text.StringBuilder.Append), calling mscorsvr!Ordinal76+0x1d925 ... (microsoft.public.biztalk.server) - Re: When is a function not a function?
... the exception thrown is "o is not a function", ... from throwing an exception) or by testing that conditions that would result in an exception being thrown don't apply before taking actions that may result in their being thrown. ... The act of calling the object has not been shown to throw an error. ... Given that knowing something is callable is never enough to tell you that calling it will be error free you are just describing a stupid design and then saying that the aspects of the design that make it stupid become a problem in context. ... (comp.lang.javascript) |
|