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. 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 …

  3. Catch and print full Python exception traceback without halting/exiting ...

    I think that this only works if you raise and then catch the exception, but not if you try getting the traceback before raising an exception object that you create, which you might want to do in some …

  4. 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 …

  5. Is there a TRY CATCH command in Bash - Stack Overflow

    May 8, 2017 · I'm writing a shell script and need to check that a terminal app has been installed. I want to use a TRY/CATCH command to do this unless there is a neater way.

  6. 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?

  7. 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, 10 months ago Modified 7 months ago Viewed 1.7m times

  8. 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:

  9. 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 …

  10. 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.