mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 22:37:27 -08:00
Make some lexing errors more informative (#4167)
Signed-off-by: Henri DF <henridf@gmail.com>
This commit is contained in:
parent
7e376dfc89
commit
986674a790
|
@ -210,7 +210,7 @@ func (p *parser) parseSeriesDesc() (m labels.Labels, vals []sequenceValue, err e
|
||||||
p.next()
|
p.next()
|
||||||
k = math.Float64frombits(value.StaleNaN)
|
k = math.Float64frombits(value.StaleNaN)
|
||||||
} else {
|
} else {
|
||||||
p.errorf("expected number or 'stale' in %s but got %s", ctx, t.desc())
|
p.errorf("expected number or 'stale' in %s but got %s (value: %s)", ctx, t.desc(), p.peek())
|
||||||
}
|
}
|
||||||
vals = append(vals, sequenceValue{
|
vals = append(vals, sequenceValue{
|
||||||
value: k,
|
value: k,
|
||||||
|
@ -222,7 +222,7 @@ func (p *parser) parseSeriesDesc() (m labels.Labels, vals []sequenceValue, err e
|
||||||
} else if t.typ == itemEOF {
|
} else if t.typ == itemEOF {
|
||||||
break
|
break
|
||||||
} else if t.typ != itemADD && t.typ != itemSUB {
|
} else if t.typ != itemADD && t.typ != itemSUB {
|
||||||
p.errorf("expected next value or relative expansion in %s but got %s", ctx, t.desc())
|
p.errorf("expected next value or relative expansion in %s but got %s (value: %s)", ctx, t.desc(), p.peek())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expand the repeated offsets into values.
|
// Expand the repeated offsets into values.
|
||||||
|
|
Loading…
Reference in a new issue