Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle every error #21

Merged
merged 2 commits into from
Oct 25, 2024
Merged

handle every error #21

merged 2 commits into from
Oct 25, 2024

Conversation

Guiorgy
Copy link
Contributor

@Guiorgy Guiorgy commented Feb 8, 2024

Currently, handle_error, and thus the VACKUP_FAILURE_SCRIPT script as well, is only called if an executed command exits with an error. They are not called when the script exits with its own error, for example: echo "Error: Volume $VOLUME_NAME does not exist"; exit 1. This PR adds a new error function that ensures the handle_error function is called at the end with the correct caller line number, and changes every exit 1 call in the script to error instead.

Also fixed the inconsistency in the "Volume $VOLUME_NAME does not exist, creating..." message and changed it into a wanring instead of an error:

echo "Error: Volume $VOLUME_NAME does not exist" # old
echo "Warning: Volume $VOLUME_NAME does not exist, creating..." # new

and

echo "Volume $VOLUME_NAME does not exist, creating..." # old
echo "Warning: Volume $VOLUME_NAME does not exist, creating..." # new

also changed the "Volume $VOLUME_NAME does not exist, creating..." message into a warning
@Guiorgy
Copy link
Contributor Author

Guiorgy commented Feb 8, 2024

Also, FYI the workflow is failing with the following message:

[Invalid workflow file: .github/workflows/linter.yml#L14](https://github.com/BretFisher/docker-vackup/actions/runs/7829440253/workflow)
error parsing called workflow ".github/workflows/linter.yml" -> "bretfisher/super-linter-workflow/.github/workflows/super-linter.yaml@main" : failed to fetch workflow: workflow was not found.

@BretFisher BretFisher merged commit f62e2bb into BretFisher:main Oct 25, 2024
@Guiorgy Guiorgy deleted the handle-all-errors branch November 1, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants