Skip to content

Commit 08d62a2

Browse files
authored
refactor(jsonschema): change error returned from json.Unmarshal to wrapped error (#83) (#85)
this allows the caller get to the underlying error
1 parent 69ae567 commit 08d62a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

schema.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ func (s *Schema) validateSchemakeywords(ctx context.Context, currentState *Valid
325325
func (s *Schema) ValidateBytes(ctx context.Context, data []byte) ([]KeyError, error) {
326326
var doc interface{}
327327
if err := json.Unmarshal(data, &doc); err != nil {
328-
return nil, fmt.Errorf("error parsing JSON bytes: %s", err.Error())
328+
return nil, fmt.Errorf("error parsing JSON bytes: %w", err)
329329
}
330330
vs := s.Validate(ctx, doc)
331331
return *vs.Errs, nil

0 commit comments

Comments
 (0)