Introduce error serialization