mirror of
https://github.com/hanzoai/traces.git
synced 2026-10-30 18:20:41 +00:00
68d1207a93
Bumps [github.com/alecthomas/kong](https://github.com/alecthomas/kong) from 1.8.1 to 1.9.0. - [Release notes](https://github.com/alecthomas/kong/releases) - [Commits](https://github.com/alecthomas/kong/compare/v1.8.1...v1.9.0) --- updated-dependencies: - dependency-name: github.com/alecthomas/kong dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
22 lines
501 B
Go
22 lines
501 B
Go
package kong
|
|
|
|
// ParseError is the error type returned by Kong.Parse().
|
|
//
|
|
// It contains the parse Context that triggered the error.
|
|
type ParseError struct {
|
|
error
|
|
Context *Context
|
|
exitCode int
|
|
}
|
|
|
|
// Unwrap returns the original cause of the error.
|
|
func (p *ParseError) Unwrap() error { return p.error }
|
|
|
|
// ExitCode returns the status that Kong should exit with if it fails with a ParseError.
|
|
func (p *ParseError) ExitCode() int {
|
|
if p.exitCode == 0 {
|
|
return exitNotOk
|
|
}
|
|
return p.exitCode
|
|
}
|