mirror of
https://github.com/prometheus/prometheus
synced 2025-01-03 21:12:13 +00:00
Merge pull request #13031 from zenador/hide-pos-info-for-warnings
Hide position info for warnings when position is unknown
This commit is contained in:
commit
c8332a852e
@ -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