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

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

  6. SQL Server TRY CATCH FINALLY - Stack Overflow

    Sep 11, 2014 · The try/catch approach can't manage with common resource allocation/dealocation tasks such as sp_OACreate / sp_OADestroy, sp_xml_preparedocument / sp_xml_removedocument, …

  7. Placement of catch BEFORE and AFTER then - Stack Overflow

    In the second scheme, if the promise p rejects, then the .catch() handler is called. If you return a normal value or a promise that eventually resolves from the .catch() handler (thus "handling" the error), then …

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

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

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