lib/serialization: support the Error class