Skip to content

Commit 87cfd5d

Browse files
add other restic exit codes
1 parent b6b8285 commit 87cfd5d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

constants/global.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,14 @@ const (
4242
ScheduleLockModeOptionIgnore = "ignore"
4343
)
4444

45+
// Exit codes from restic
4546
const (
46-
ExitCodeSuccess = 0
47-
ExitCodeError = 1
48-
ExitCodeWarning = 3
47+
ResticExitCodeSuccess = 0
48+
ResticExitCodeError = 1
49+
ResticExitCodeGoRuntimeError = 2
50+
ResticExitCodeWarning = 3
51+
ResticExitCodeNoRepository = 10
52+
ResticExitCodeFailLockRepository = 11
53+
ResticExitCodeWrongPassword = 12
54+
ResticExitCodeInterrupted = 130
4955
)

monitor/error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func IsWarning(err error) bool {
1717
}
1818
exitErr := &exec.ExitError{}
1919
if errors.As(err, &exitErr) {
20-
return exitErr.ExitCode() == constants.ExitCodeWarning
20+
return exitErr.ExitCode() == constants.ResticExitCodeWarning
2121
}
2222
// so far, internal warning is only used in unit tests
2323
warn := &InternalWarningError{}

0 commit comments

Comments
 (0)