code: def from_exception(exc, uuid=None):
          
          if not isinstance(exc, Error):
              exc = Error(code=500, message=str(exc))
  
          return Result(
              uuid=exc.extra.get("uuid", uuid or random_uuid()),
              retcode=exc.code, stderr=exc.message,
              retval=dict(error=ErrorSchema().dump(exc))
          )
docs: Serialize an exception into a result
  
          :param Exception exc: Exception raised
          :param str uuid: Current Kafka :class:`kser.transport.Message` uuid
          :rtype: :class:`kser.result.Result`