|
|
|
|
|
by maxdamantus
214 days ago
|
|
Sounds like the right intent to me. To pinpoint your existing quote from the documentation: > The finally block always executes when the try block exits. This ensures that the finally block is executed even if an unexpected exception occurs. The intent of the transaction code is that the consistency is checked (using `tx.commit()`) "even if an unexpected exception occurs". I'm not sure how else to interpret that to be honest. If you've got a clearer way of expressing this, feel free to explain. |
|
A transaction failing is the opposite of an unexpected event. Transactions failing is a central use case of any transaction. Therefore it should be handled explicitly instead of using exceptions.
Exceptions are for unexpected events such as the node running out of memory, or a process failing to write to disk.