...
1 package jsonpatch
2
3 import "fmt"
4
5
6
7
8 type AccumulatedCopySizeError struct {
9 limit int64
10 accumulated int64
11 }
12
13
14 func NewAccumulatedCopySizeError(l, a int64) *AccumulatedCopySizeError {
15 return &AccumulatedCopySizeError{limit: l, accumulated: a}
16 }
17
18
19 func (a *AccumulatedCopySizeError) Error() string {
20 return fmt.Sprintf("Unable to complete the copy, the accumulated size increase of copy is %d, exceeding the limit %d", a.accumulated, a.limit)
21 }
22
23
24
25 type ArraySizeError struct {
26 limit int
27 size int
28 }
29
30
31 func NewArraySizeError(l, s int) *ArraySizeError {
32 return &ArraySizeError{limit: l, size: s}
33 }
34
35
36 func (a *ArraySizeError) Error() string {
37 return fmt.Sprintf("Unable to create array of size %d, limit is %d", a.size, a.limit)
38 }
39
View as plain text