Skip to content

Commit

Permalink
fix(tryCatch): make it possible to exit with a non-zero status code (f…
Browse files Browse the repository at this point in the history
…ixes #50)
  • Loading branch information
niieani committed Jul 8, 2018
1 parent 84c4511 commit 1914fe3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions example/exitcode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

source "$( cd "${BASH_SOURCE[0]%/*}" && pwd )/../lib/oo-bootstrap.sh"

import util/exception util/tryCatch util/log util/test

exit 1
3 changes: 2 additions & 1 deletion lib/util/tryCatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ Exception::SetupTemp() {
}

Exception::CleanUp() {
local exitVal=$?
rm -f $__oo__storedExceptionLineFile $__oo__storedExceptionSourceFile $__oo__storedExceptionBacktraceFile $__oo__storedExceptionFile || exit 1
exit 0
exit $exitVal
}

Exception::ResetStore() {
Expand Down

0 comments on commit 1914fe3

Please sign in to comment.