-
-
Notifications
You must be signed in to change notification settings - Fork 744
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
optional more specific return codes #7928
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## 1.2-maint #7928 +/- ##
=============================================
+ Coverage 82.33% 82.59% +0.25%
=============================================
Files 38 38
Lines 10781 10926 +145
Branches 2064 2097 +33
=============================================
+ Hits 8877 9024 +147
+ Misses 1352 1342 -10
- Partials 552 560 +8 ☔ View full report in Codecov by Sentry. |
ThomasWaldmann
force-pushed
the
new-rc-1.2
branch
2 times, most recently
from
November 9, 2023 22:43
f62b4fe
to
60663d6
Compare
ThomasWaldmann
force-pushed
the
new-rc-1.2
branch
2 times, most recently
from
November 13, 2023 19:12
728a881
to
96ce241
Compare
ThomasWaldmann
force-pushed
the
new-rc-1.2
branch
3 times, most recently
from
November 18, 2023 19:34
2ed959a
to
1243608
Compare
…odes If not set, it will default to "legacy" (always return 2 for errors). This commit only changes the Error exception class and its subclasses. The more specific exit codes need to be defined via .exit_mcode in the subclasses.
- also output modern rc and traceback yes/no - recursive list of Error subclasses
- _export_tar: remove unneeded call to set_ec print_warning() already sets the exit code to EXIT_WARNING. - msgpack version check: raise Error instead of calling set_ec
previously, this was handled in RPCError handler and always resulted in rc 2. now re-raise Lock Exceptions locally, so it gives rc 2 (legacy) or 7x (modern).
Users using recently created repos (after borg 1.0.9) or who followed the upgrade procedure of 1.0.9 or >1.2.4 will never see this error msg. So, have it as short as and similar to the ArchiveTAMRequiredError.
ThomasWaldmann
force-pushed
the
new-rc-1.2
branch
from
December 2, 2023 21:59
1243608
to
e5c4a57
Compare
- implement updating exit code based on severity, including modern codes - extend print_warning with kwargs wc (warning code) and wt (warning type) - update a global warnings_list with warning_info elements - create a class hierarchy below BorgWarning class similar to Error class - diff: change harmless warnings about speed to rc == 0 - delete --force --force: change harmless warnings to rc == 0 Also: - have BackupRaceConditionError as a more precise subclass of BackupError
also: use more union operators rather than .union()
this is not needed and getting rid of it makes the code / behaviour simpler to understand: if a fatal error is detected, we throw an exception. if we encounter something warning worthy, we emit and collect the warning. in a few cases, we directly call set_ec to set the exit code as needed, e.g. if passing it through from a subprocess. also: - get rid of Archiver.exit_code - assert that return value of archiver methods is None - fix a print_warning call to use the correct formatting method
stop directly accessing the variables from other modules. prefix with underscore to indicate that these shall only be used within this module and every other user shall call the respective functions.
ThomasWaldmann
force-pushed
the
new-rc-1.2
branch
from
December 15, 2023 18:43
f2486e4
to
38cb364
Compare
if we do multiple calls to Archiver.do_something(), we need to reset the ec / warnings after each call, otherwise they will keep growing (in severity, in length).
superseded by #7976. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
default behaviour is mostly unchanged, but user can enable this via an environment variable.
fixes #6756 and some other issues.