Catch System.Exception
and switch on the types
catch (Exception ex)
{
if (ex is FormatException || ex is OverflowException)
{
WebId = Guid.Empty;
return;
}
throw;
}
More Related Contents:
- How slow are .NET exceptions?
- How using try catch for exception handling is best practice
- How to rethrow InnerException without losing stack trace in C#?
- What is the proper way to rethrow an exception in C#? [duplicate]
- TAP global exception handler
- Avoiding first chance exception messages when the exception is safely handled
- .NET – What’s the best way to implement a “catch all exceptions handler”
- Troubleshooting BadImageFormatException
- Does a locked object stay locked if an exception occurs inside it?
- User Activity Logging, Telemetry (and Variables in Global Exception Handlers)
- Active Directory COM Exception – An operations error occurred (0x80072020)
- How to avoid a System.Runtime.InteropServices.COMException?
- InvalidProgramException / Common Language Runtime detected an invalid program
- Image.FromStream() method returns Invalid Argument exception
- Read Big TXT File, Out of Memory Exception
- Best practices: throwing exceptions from properties
- How to prevent an exception in a background thread from terminating an application?
- How to serialize an Exception object in C#?
- More Elegant Exception Handling Than Multiple Catch Blocks? [duplicate]
- ArgumentOutOfRangeException on initialized List
- How can I handle forms authentication timeout exceptions in ASP.NET?
- Exception.Message vs Exception.ToString()
- Is there a built in .NET exception that indicates an illegal object state?
- In a .net Exception how to get a stacktrace with argument values
- How do I determine the HResult for a System.IO.IOException?
- Catch Application Exceptions in a Windows Forms Application
- Which exceptions shouldn’t I catch?
- The ObjectContext instance has been disposed and can no longer be used for operations that require a connection [duplicate]
- Could not load file or assembly ‘System.Windows.Interactivity’ [duplicate]
- Which types of exception not to catch?