Exception: Petra::HandlerException
- Inherits:
-
ExtendedError
- Object
- StandardError
- PetraError
- ExtendedError
- Petra::HandlerException
- Defined in:
- lib/petra/exceptions.rb
Direct Known Subclasses
Instance Method Summary collapse
- #continuable? ⇒ Boolean
- #continue! ⇒ Object
-
#reset_transaction! ⇒ Object
(also: #reset!)
Resets the currently active transaction This will stop the transaction execution, so make sure that you wrap important code which has to be executed afterwards in an
ensure. - #retry! ⇒ Object
-
#rollback_transaction! ⇒ Object
(also: #rollback!)
Requests a section rollback on the currently active transaction This will stop the transaction execution, so make sure that you wrap important code which has to be executed afterwards in an
ensure.
Methods inherited from ExtendedError
Constructor Details
This class inherits a constructor from Petra::ExtendedError
Instance Method Details
#continuable? ⇒ Boolean
72 73 74 |
# File 'lib/petra/exceptions.rb', line 72 def continuable? false end |
#continue! ⇒ Object
67 68 69 70 |
# File 'lib/petra/exceptions.rb', line 67 def continue! fail Petra::ContinuationError, 'The transaction processing cannot be resumed.' unless continuable? @continuation.call end |
#reset_transaction! ⇒ Object Also known as: reset!
Resets the currently active transaction This will stop the transaction execution, so make sure that you wrap important code which has to be executed afterwards in an ensure
49 50 51 52 |
# File 'lib/petra/exceptions.rb', line 49 def reset_transaction! @reset = true Petra.transaction_manager.reset_transaction end |
#retry! ⇒ Object
40 41 42 |
# File 'lib/petra/exceptions.rb', line 40 def retry! fail Petra::Retry end |
#rollback_transaction! ⇒ Object Also known as: rollback!
Requests a section rollback on the currently active transaction This will stop the transaction execution, so make sure that you wrap important code which has to be executed afterwards in an ensure
59 60 61 62 |
# File 'lib/petra/exceptions.rb', line 59 def rollback_transaction! @rollback = true Petra.transaction_manager.rollback_transaction end |