Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# catch multiple exceptions at once

catch (Exception ex)            
{                
    if (ex is FormatException or OverflowException) // Chain as many or xException as you need
    {
        WebId = Guid.Empty;
        return;
    }
    
    throw;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #catch #multiple #exceptions
ADD COMMENT
Topic
Name
2+1 =