Skip to content

Commit

Permalink
add document comments to methods of HaltError
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Apr 1, 2024
1 parent 13da5a1 commit 79e6f53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,13 @@ func (err *HaltError) Error() string {
return "halt " + (*exitCodeError)(err).Error()
}

// Value returns the value of the error. This implements [ValueError],
// but halt error is not catchable by try-catch.
func (err *HaltError) Value() any {
return (*exitCodeError)(err).Value()
}

// ExitCode returns the exit code of the error.
func (err *HaltError) ExitCode() int {
return (*exitCodeError)(err).ExitCode()
}
Expand Down

0 comments on commit 79e6f53

Please sign in to comment.