grml/grml-debootstrap — pull request #51 by adrelanos (2014-12-16 18:55:16+00:00)
Title: better error handler version2

Implements #22 (better error handling). Hopefully addresses concerns from previous pull request "better error handler" (#31). This time it's a much less intrusive, smaller change.

Thanks for @hartwork for telling me about `set -E`.

```
export REPORT_TRAP_ERR='yes'
```

Reports unexpected non-zero exit codes.

```
export FAIL_TRAP_ERR='yes'
```

Fails on unexpected non-zero exit codes.

I created a VM image using both options. Congratulations. So far no unexpected non-zero exit codes. If this gets merged, I suggest to leave it disabled by default in short term and to enable `export REPORT_TRAP_ERR='yes'` as developer/tester. It will report unexpected non-zero exit codes but not annoy any further. Later when we're really sure to have all exit codes under control we can consider making `export FAIL_TRAP_ERR='yes'` the default.