Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# catch multiple exceptions

// if C# v6+, you can use exception filters
catch (Exception ex) when (ex is FormatException || ex is OverflowException)
{
  // do something
}
Source by csharp.today #
 
PREVIOUS NEXT
Tagged: #catch #multiple #exceptions
ADD COMMENT
Topic
Name
9+8 =