@@ -25,7 +25,7 @@ type ObjectDecoder struct {
2525func NewObjectDecoder (data []byte ) (* ObjectDecoder , error ) {
2626 var remainingFields map [string ]json.RawMessage
2727 if err := json .Unmarshal (data , & remainingFields ); err != nil {
28- return nil , fmt .Errorf ("Failed to unmarshal extension properties: %v\n Input: %s " , err , data )
28+ return nil , fmt .Errorf ("failed to unmarshal extension properties: %v (%s) " , err , data )
2929 }
3030 return & ObjectDecoder {
3131 Data : data ,
@@ -41,18 +41,18 @@ func (decoder *ObjectDecoder) DecodeExtensionMap() map[string]json.RawMessage {
4141func (decoder * ObjectDecoder ) DecodeStructFieldsAndExtensions (value interface {}) error {
4242 reflection := reflect .ValueOf (value )
4343 if reflection .Kind () != reflect .Ptr {
44- panic (fmt .Errorf ("Value %T is not a pointer" , value ))
44+ panic (fmt .Errorf ("value %T is not a pointer" , value ))
4545 }
4646 if reflection .IsNil () {
47- panic (fmt .Errorf ("Value %T is nil" , value ))
47+ panic (fmt .Errorf ("value %T is nil" , value ))
4848 }
4949 reflection = reflection .Elem ()
5050 for (reflection .Kind () == reflect .Interface || reflection .Kind () == reflect .Ptr ) && ! reflection .IsNil () {
5151 reflection = reflection .Elem ()
5252 }
5353 reflectionType := reflection .Type ()
5454 if reflectionType .Kind () != reflect .Struct {
55- panic (fmt .Errorf ("Value %T is not a struct" , value ))
55+ panic (fmt .Errorf ("value %T is not a struct" , value ))
5656 }
5757 typeInfo := GetTypeInfo (reflectionType )
5858
@@ -87,7 +87,7 @@ func (decoder *ObjectDecoder) DecodeStructFieldsAndExtensions(value interface{})
8787 continue
8888 }
8989 }
90- return fmt .Errorf ("Error while unmarshalling property '%s' (%s): %v" ,
90+ return fmt .Errorf ("failed to unmarshal property %q (%s): %v" ,
9191 field .JSONName , fieldValue .Type ().String (), err )
9292 }
9393 if ! isPtr {
@@ -109,7 +109,7 @@ func (decoder *ObjectDecoder) DecodeStructFieldsAndExtensions(value interface{})
109109 continue
110110 }
111111 }
112- return fmt .Errorf ("Error while unmarshalling property '%s' (%s): %v" ,
112+ return fmt .Errorf ("failed to unmarshal property %q (%s): %v" ,
113113 field .JSONName , fieldPtr .Type ().String (), err )
114114 }
115115
0 commit comments