From 754e7df97e6ac308e5b4cf7c5b75901b4cc97692 Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Sat, 28 Oct 2023 00:38:32 +0800 Subject: [PATCH] Make it possible to unwrap annotation errors Signed-off-by: Jeanette Tan --- util/annotations/annotations.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/annotations/annotations.go b/util/annotations/annotations.go index 52cfb114b..519a09f58 100644 --- a/util/annotations/annotations.go +++ b/util/annotations/annotations.go @@ -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 {