// if C# v6+, you can use exception filters catch (Exception ex) when (ex is FormatException || ex is OverflowException) { // do something }