Commit Graph

15 Commits

Author SHA1 Message Date
Thomas Waldmann 2e05c234b6
BackupErrors get caught and give warning RCs
also: use more union operators rather than .union()
2024-02-15 18:15:10 +01:00
Thomas Waldmann 97dd287584
raise BackupOSError subclasses 2024-02-15 17:53:53 +01:00
Thomas Waldmann 9ac4672254
add NotFoundWarning 2024-02-15 17:04:21 +01:00
Thomas Waldmann 5168a97782
extend errorlist script to warnings, update docs 2024-02-14 02:04:44 +01:00
Thomas Waldmann 982aeb56a7
more detailled warnings for source file OSErrors 2024-02-14 02:00:19 +01:00
Thomas Waldmann e8fa4986cc
BackupError->BackupWarning, BackupOSError->BackupOSWarning 2024-02-14 01:59:08 +01:00
Thomas Waldmann 900a1674df
move Backup*Error to errors module 2024-02-14 01:40:55 +01:00
Thomas Waldmann c704e5ea9e
new warnings infrastructure to support modern exit codes
- 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
2024-02-14 01:26:12 +01:00
Thomas Waldmann 9de07ebd46
update "modern" error RCs (docs and code) 2024-02-13 22:58:02 +01:00
Thomas Waldmann 1b09d0efd7
BORG_EXIT_CODES=modern can be set to get more specific process exit codes
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.
2024-02-13 19:53:17 +01:00
Thomas Waldmann 7957af562d blacken all the code
https://black.readthedocs.io/
2022-07-06 16:34:38 +02:00
Elmar Hoffmann c34df51e3e import IntegrityError used as base class with according name
This not only brings code style in line with the other helpers that do the
same thing this way, but also does away with an unnecessary absolute import
using the borg module name explicitly.
2022-05-28 16:07:20 +02:00
Andrea Gelmini 72e7c46fa7 Fix typos 2021-01-07 17:54:33 +01:00
finefoot 235b131015
Allow message for Error base class 2020-04-11 12:58:04 +02:00
Thomas Waldmann 3e78549f76 helpers: split into smaller modules 2017-08-07 23:05:46 +02:00