mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
state: print encoding error before object
This prevents a very large object string from pushing an error message from saving (which is usually something informative like "type Foo does not implement SaverLoader") off the edge of the line. cl/605534648 already did this for loading. PiperOrigin-RevId: 631622344
This commit is contained in:
+1
-1
@@ -772,7 +772,7 @@ func (es *encodeState) Save(obj reflect.Value) {
|
||||
}
|
||||
}); err != nil {
|
||||
// Include the object in the error message.
|
||||
Failf("encoding error at object %#v: %w", oes.obj.Interface(), err)
|
||||
Failf("encoding error: %w\nfor object %#v", err, oes.obj.Interface())
|
||||
}
|
||||
|
||||
// Check that we have objects to serialize.
|
||||
|
||||
Reference in New Issue
Block a user