Skip to content

Commit

Permalink
Merge pull request prometheus#13039 from zenador/make-anno-err-visible
Browse files Browse the repository at this point in the history
Make it possible to unwrap annotation error
  • Loading branch information
beorn7 authored Oct 27, 2023
2 parents 05356e7 + 754e7df commit e9b9451
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions util/annotations/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ func (e annoErr) Error() string {
return fmt.Sprintf("%s (%s)", e.Err, e.PositionRange.StartPosInput(e.Query, 0))
}

func (e annoErr) Unwrap() error {
return e.Err
}

// NewInvalidQuantileWarning is used when the user specifies an invalid quantile
// value, i.e. a float that is outside the range [0, 1] or NaN.
func NewInvalidQuantileWarning(q float64, pos posrange.PositionRange) annoErr {
Expand Down

0 comments on commit e9b9451

Please sign in to comment.