()
| 37 | } |
| 38 | |
| 39 | func (ref *ExecutionContext) doCleanup() { |
| 40 | if len(ref.cleanupHandlers) == 0 { |
| 41 | return |
| 42 | } |
| 43 | |
| 44 | //call cleanup handlers in reverse order |
| 45 | for i := len(ref.cleanupHandlers) - 1; i >= 0; i-- { |
| 46 | cleanup := ref.cleanupHandlers[i] |
| 47 | if cleanup != nil { |
| 48 | cleanup() |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | func (ref *ExecutionContext) FailOn(err error) { |
| 54 | if err != nil { |