CONDITION_SNAPSHOT_START returning error does not trigger hooks (e.g. CONDITION_SNAPSHOT_END)
Describe the bug
When running a command hook for CONDITION_SNAPSHOT_START that exits with an error (error code > 0), then no hooks like CONDITION_SNAPSHOT_END or CONDITION_SNAPSHOT_ERROR are being triggered.
To Reproduce Steps to reproduce the behavior:
- Define a command hook on
CONDITION_SNAPSHOT_STARTlike this:
- Content of the script is
Write-Error aaaaadff
Write-Warning warrrrrnnn
exit 1- Define a command hook on
CONDITION_SNAPSHOT_ENDlike this:
Start the backup
The backup will fail due to the exit code of 1 yielded by the snapshot start script.
The end hook is not being triggered. Only the start hook is triggered:
Expected behavior
CONDITION_SNAPSHOT_END should always be triggered when a snapshot ends. It should be triggered in the case the snapshot fails due to a fatal exit code in the snapshot start hook.
CONDITION_SNAPSHOT_ERROR should also be triggered if the snapshot start hook yields a fatal error.
In the reproduction steps described above, both events are not triggered.
Platform Info
- Windows 10 x64
- Backrest Version: 1.9.2-SNAPSHOT-899f30c
Source: garethgeorge/backrest