mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-11 16:14:05 -08:00
b5c833ca21
* Update go.mod dependencies before release Signed-off-by: Julius Volz <julius.volz@gmail.com> * Add issue for showing query warnings in promtool Signed-off-by: Julius Volz <julius.volz@gmail.com> * Revert json-iterator back to 1.1.6 It produced errors when marshaling Point values with special float values. Signed-off-by: Julius Volz <julius.volz@gmail.com> * Fix expected step values in promtool tests after client_golang update Signed-off-by: Julius Volz <julius.volz@gmail.com> * Update generated protobuf code after proto dep updates Signed-off-by: Julius Volz <julius.volz@gmail.com>
39 lines
1.2 KiB
Go
39 lines
1.2 KiB
Go
package jsonpatch
|
|
|
|
import "fmt"
|
|
|
|
// AccumulatedCopySizeError is an error type returned when the accumulated size
|
|
// increase caused by copy operations in a patch operation has exceeded the
|
|
// limit.
|
|
type AccumulatedCopySizeError struct {
|
|
limit int64
|
|
accumulated int64
|
|
}
|
|
|
|
// NewAccumulatedCopySizeError returns an AccumulatedCopySizeError.
|
|
func NewAccumulatedCopySizeError(l, a int64) *AccumulatedCopySizeError {
|
|
return &AccumulatedCopySizeError{limit: l, accumulated: a}
|
|
}
|
|
|
|
// Error implements the error interface.
|
|
func (a *AccumulatedCopySizeError) Error() string {
|
|
return fmt.Sprintf("Unable to complete the copy, the accumulated size increase of copy is %d, exceeding the limit %d", a.accumulated, a.limit)
|
|
}
|
|
|
|
// ArraySizeError is an error type returned when the array size has exceeded
|
|
// the limit.
|
|
type ArraySizeError struct {
|
|
limit int
|
|
size int
|
|
}
|
|
|
|
// NewArraySizeError returns an ArraySizeError.
|
|
func NewArraySizeError(l, s int) *ArraySizeError {
|
|
return &ArraySizeError{limit: l, size: s}
|
|
}
|
|
|
|
// Error implements the error interface.
|
|
func (a *ArraySizeError) Error() string {
|
|
return fmt.Sprintf("Unable to create array of size %d, limit is %d", a.size, a.limit)
|
|
}
|