use 11 for the panic exit code

This commit is contained in:
James Bardin 2021-10-28 15:34:02 -04:00
parent bd37f43daa
commit 583e3a5f0b
1 changed files with 5 additions and 1 deletions

View File

@ -42,7 +42,11 @@ func PanicHandler() {
// When called from a deferred function, debug.PrintStack will include the // When called from a deferred function, debug.PrintStack will include the
// full stack from the point of the pending panic. // full stack from the point of the pending panic.
debug.PrintStack() debug.PrintStack()
os.Exit(2)
// An exit code of 11 keeps us out of the way of the detailed exitcodes
// from plan, and also happens to be the same code as SIGSEGV which is
// roughly the same type of condition that causes most panics.
os.Exit(11)
} }
const pluginPanicOutput = ` const pluginPanicOutput = `