mirror of
https://github.com/prometheus/prometheus.git
synced 2025-08-06 06:07:11 +02:00
Hide position info for warnings when position is unknown (empty query string passed in)
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
This commit is contained in:
parent
f2e02c52db
commit
72cc93d225
@ -116,6 +116,9 @@ type annoErr struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e annoErr) Error() string {
|
func (e annoErr) Error() string {
|
||||||
|
if e.Query == "" {
|
||||||
|
return e.Err.Error()
|
||||||
|
}
|
||||||
return fmt.Sprintf("%s (%s)", e.Err, e.PositionRange.StartPosInput(e.Query, 0))
|
return fmt.Sprintf("%s (%s)", e.Err, e.PositionRange.StartPosInput(e.Query, 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user