Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# catch two exceptions in one block

catch (Exception ex)            
{                
    if (ex is FormatException || ex is OverflowException)
    {
        WebId = Guid.Empty;
        return;
    }

    throw;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #catch #exceptions #block
ADD COMMENT
Topic
Name
1+2 =