Catch System.Exception and switch on the types
System.Exception
catch (Exception ex) { if (ex is FormatException || ex is OverflowException) { WebId = Guid.Empty; return; } throw; }