mirror of
https://github.com/safing/portmaster
synced 2025-09-04 11:39:29 +00:00
Merge pull request #880 from safing/feature/add-not-restart-exit-code
Add exit code for controlled failures
This commit is contained in:
commit
090fec0549
1 changed files with 7 additions and 0 deletions
|
@ -24,6 +24,11 @@ const (
|
||||||
// can return in order to trigger a restart after a clean shutdown.
|
// can return in order to trigger a restart after a clean shutdown.
|
||||||
RestartExitCode = 23
|
RestartExitCode = 23
|
||||||
|
|
||||||
|
// ControlledFailureExitCode is the exit code that any service started by
|
||||||
|
// portmaster-start can return in order to signify a controlled failure.
|
||||||
|
// This disables retrying and exits with an error code.
|
||||||
|
ControlledFailureExitCode = 24
|
||||||
|
|
||||||
exeSuffix = ".exe"
|
exeSuffix = ".exe"
|
||||||
zipSuffix = ".zip"
|
zipSuffix = ".zip"
|
||||||
)
|
)
|
||||||
|
@ -431,6 +436,8 @@ func parseExitError(err error) (restart bool, errWithCtx error) {
|
||||||
return true, fmt.Errorf("error during execution: %w", err)
|
return true, fmt.Errorf("error during execution: %w", err)
|
||||||
case RestartExitCode:
|
case RestartExitCode:
|
||||||
return true, nil
|
return true, nil
|
||||||
|
case ControlledFailureExitCode:
|
||||||
|
return false, errors.New("controlled failure, check logs")
|
||||||
default:
|
default:
|
||||||
return true, fmt.Errorf("unknown exit code %w", exErr)
|
return true, fmt.Errorf("unknown exit code %w", exErr)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue