Correct error_code in err_report (#124) (#125)

This commit is contained in:
Gert Goet 2019-11-18 11:56:18 +01:00 committed by Kevin van Zonneveld
parent 0d096350b0
commit 599faf3830
4 changed files with 5 additions and 4 deletions

View File

@ -13,6 +13,7 @@ Unplanned.
Released: TBA.
[Diff](https://github.com/kvz/bash3boilerplate/compare/v2.4.1...master).
- [x] Capture correct error_code in err_report (#124, @eval)
- [ ]
## v2.4.1

View File

@ -167,6 +167,8 @@ We are looking for endorsements! Are you also using b3bp? [Let us know](https://
- [Germain Masse](https://github.com/gmasse)
- [A. G. Madi](https://github.com/warpengineer)
- [Lukas Stockner](mailto:oss@genesiscloud.com)
- [Gert Goet](https://github.com/eval)
## License

View File

@ -61,8 +61,7 @@ trap __b3bp_cleanup_before_exit EXIT
# requires `set -o errtrace`
__b3bp_err_report() {
local error_code
error_code=${?}
local error_code=${?}
# shellcheck disable=SC2154
error "Error in ${__file} in function ${1} on line ${2}"
exit ${error_code}

View File

@ -360,8 +360,7 @@ trap __b3bp_cleanup_before_exit EXIT
# requires `set -o errtrace`
__b3bp_err_report() {
local error_code
error_code=${?}
local error_code=${?}
error "Error in ${__file} in function ${1} on line ${2}"
exit ${error_code}
}