Skip to content

Commit

Permalink
Remove magic number
Browse files Browse the repository at this point in the history
  • Loading branch information
elmattic committed Jan 9, 2025
1 parent d111d3d commit ff508b0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/shim/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ impl fmt::Display for ExitCode {
code if code > ExitCode_latest::SYS_MISSING_RETURN.value()
&& code < ExitCode_latest::FIRST_USER_EXIT_CODE =>
{
write!(f, "SysErrReserved{}({})", code - 10, code)
// We want to match Lotus display exit codes
// See <https://github.com/filecoin-project/go-state-types/blob/v0.15.0/exitcode/names.go#L16-L21>
write!(
f,
"SysErrReserved{}({})",
code - (ExitCode_latest::SYS_ASSERTION_FAILED.value()),
code
)
}
_ => write!(f, "{}", self.value()),
}
Expand Down

0 comments on commit ff508b0

Please sign in to comment.