mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08: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 {
|
||||
if e.Query == "" {
|
||||
return e.Err.Error()
|
||||
}
|
||||
return fmt.Sprintf("%s (%s)", e.Err, e.PositionRange.StartPosInput(e.Query, 0))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue