json error text tests fix
This commit is contained in:
parent
76d0d601a0
commit
d0069e73f8
@ -4,6 +4,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrUnmarshal = errors.New("unmarshal error")
|
var ErrUnmarshal = errors.New("unmarshal error")
|
||||||
@ -30,7 +31,7 @@ func NewUnmarshalError(err error) *UnmarshalError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *UnmarshalError) WithReader(reader io.Reader) *UnmarshalError {
|
func (u *UnmarshalError) WithReader(reader io.Reader) *UnmarshalError {
|
||||||
content, _ := io.ReadAll(reader)
|
content, _ := ioutil.ReadAll(reader)
|
||||||
u.Content = content
|
u.Content = content
|
||||||
return u
|
return u
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user