mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
all: remove pkg/errors
This commit is contained in:
committed by
Ariel Mashraki
parent
f0710aa004
commit
eb87d64980
@@ -11,7 +11,6 @@ import (
|
||||
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"github.com/modern-go/reflect2"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// DecoratorOfMarshaler decorates a value encoder of a Marshaler interface.
|
||||
@@ -69,11 +68,11 @@ func (enc marshalerEncoder) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
|
||||
func (enc marshalerEncoder) encode(marshaler Marshaler, stream *jsoniter.Stream) {
|
||||
data, err := marshaler.MarshalGraphson()
|
||||
if err != nil {
|
||||
stream.Error = errors.Wrapf(err, "graphson: error calling MarshalGraphson for type %s", enc.Type)
|
||||
stream.Error = fmt.Errorf("graphson: error calling MarshalGraphson for type %s: %w", enc.Type, err)
|
||||
return
|
||||
}
|
||||
if !config.Valid(data) {
|
||||
stream.Error = errors.Errorf("graphson: syntax error when marshaling type %s", enc.Type)
|
||||
stream.Error = fmt.Errorf("graphson: syntax error when marshaling type %s", enc.Type)
|
||||
return
|
||||
}
|
||||
_, stream.Error = stream.Write(data)
|
||||
|
||||
Reference in New Issue
Block a user