tagged [finally]
Does C++ support 'finally' blocks? (And what's this 'RAII' I keep hearing about?)
Does C++ support 'finally' blocks? (And what's this 'RAII' I keep hearing about?) Does C++ support '[finally](http://java.sun.com/docs/books/tutorial/essential/exceptions/finally.html)' blocks? What i...
Using finally instead of catch
Using finally instead of catch I've seen this pattern a few times now: And I've been wondering: Why is this better than using catch for rollbacks? ``` try { DoSomethin
- Modified
- 23 May at 14:15
What happens if both catch and finally blocks throw exception?
What happens if both catch and finally blocks throw exception? What happens if both catch and finally blocks throw exception?
- Modified
- 1 Oct at 06:21
What is the purpose of "finally" in try/catch/finally
What is the purpose of "finally" in try/catch/finally The syntax will change from language to language, but this is a general question. What is the difference between this.... ``` try { Console.Writ...
- Modified
- 24 May at 14:7
Is it bad practice to return from within a try catch finally block?
Is it bad practice to return from within a try catch finally block? So I came across some code this morning that looked like this: Now this code compiles fine and works as it should, but it just doesn...
- Modified
- 20 Oct at 15:57
Is a finally block without a catch block a java anti-pattern?
Is a finally block without a catch block a java anti-pattern? I just had a pretty painful troubleshooting experience in troubleshooting some code that looked like this: The problem was difficult to tr...
- Modified
- 15 Apr at 10:44
await in try-finally block
await in try-finally block I've been playing around with the Visual Studio 14 CTP 2. This version of C# vNext enables the use of the `await` keyword inside a finally block. I am trying to figure out h...
- Modified
- 28 Jun at 18:47
Finally is not executed when in a Thread running in a Windows Service
Finally is not executed when in a Thread running in a Windows Service Can anyone explain why this finally block is not executed? I have read posts about when to expect finally block not be executed, b...
- Modified
- 10 Jul at 16:10
Try-catch-finally-return clarification
Try-catch-finally-return clarification By reading all the questions already asked in this forum related to the topic above (see title), I thoroughly understand that `finally` gets always called. (exce...
What happens if a finally block throws an exception?
What happens if a finally block throws an exception? If a finally block throws an exception, what happens? Specifically, what happens if the exception is thrown midway through a finally block. Do the...
- Modified
- 18 Jan at 09:0