Skip to content

Commit

Permalink
Do not ignore errors if data folder corrupted
Browse files Browse the repository at this point in the history
Previously, `set +e` was used, which was then carried to `ask_clean`
This may explain the problem seen in issue algorand#9.
  • Loading branch information
fabrice102 committed Mar 11, 2020
1 parent 819fb5e commit 5b14d7e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sandbox
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,12 @@ sandbox () {
# Resume or initialize sandbox
if [[ -d data ]]; then
statusline "Starting the existing sandbox..."
set +e
docker start sandbox > /dev/null
# Use variable $ERROR instead of status $?
# as we are using set -e which aborts in case of non-zero status
ERROR=0
docker start sandbox > /dev/null || ERROR=1

if [[ $? -ne 0 ]]; then
if [[ $ERROR -ne 0 ]]; then
err "Detected an error from the docker command."
if [[ $# -eq 0 ]]; then
NETWORK=$(cat data/network)
Expand All @@ -184,7 +186,6 @@ sandbox () {
statusline "Starting '$NETWORK' sandbox..."
up $NETWORK
fi
set -e
else
statusline "\nBuilding a new Docker Image..."
docker build \
Expand Down

0 comments on commit 5b14d7e

Please sign in to comment.