About 50 results
Open links in new tab
  1. c# - Catch multiple exceptions at once? - Stack Overflow

    try { WebId = new Guid(queryString["web"]); } catch (FormatException) { WebId = Guid.Empty; } catch (OverflowException) { WebId = Guid.Empty; } Is there a way to catch both exceptions and only set …

  2. C++ catching all exceptions - Stack Overflow

    Note that most crashes are not caused by exceptions in C++. You can catch all exceptions, but that won't prevent many crashes.

  3. PowerShell try/catch/finally - Stack Overflow

    Jul 21, 2011 · write-host 'CommandNotFoundException' } catch { write-host 'well, darn' } That output 'CommandNotFoundException' correctly. I vaguely remember reading elsewhere (though I couldn't …

  4. python - How can I catch multiple exceptions in one line? (in the ...

    How can I catch multiple exceptions in one line? (in the "except" block) Asked 14 years, 9 months ago Modified 7 months ago Viewed 1.7m times

  5. Manually raising (throwing) an exception in Python

    How do I raise an exception in Python so that it can later be caught via an except block?

  6. Difference between catch (Exception), catch () and just catch

    Both constructs (catch () being a syntax error, as sh4nx0r rightfully pointed out) behave the same in C#. The fact that both are allowed is probably something the language inherited from C++ syntax. , can …

  7. c# - Catching exceptions with "catch, when" - Stack Overflow

    Jul 21, 2016 · Does using the 'catch, when' feature make exception handling faster because the handler is skipped as such and the stack unwinding can happen much earlier as when compared to handling …

  8. How to catch `MESSAGE RAISING` type exception? - Stack Overflow

    Apr 4, 2024 · Given a classic ABAP exception like the following: MESSAGE ID 'XYZ' TYPE 'E' NUMBER 123 RAISING exception_name How do I catch this exception in the calling code? I have tried …

  9. PowerShell Try/Catch and Retry - Stack Overflow

    60 If you frequently need code that retries an action a number of times you could wrap your looped try..catch in a function and pass the command in a scriptblock:

  10. How to catch SqlException caused by deadlock? - Stack Overflow

    Make sure this try..catch surrounds your entire transaction. According to @Steven (see his answer for details), when the sql command fails due to the deadlock, it causes the transaction to be rolled back …