def _format_error(self, code, exc):
        err = {
            "error": code,
            "type": exc.__class__.__name__,
            "description": (exc.__doc__ or '').strip(),
            "info": None,
        }
        if len(exc.args) == 1:
            err['info'] = exc.args[0]
        elif len(exc.args) > 1:
            err['info'] = exc.args
        return err
dataset/ETHPy150Open scrapinghub/splash/splash/resources.py/_ValidatingResource._format_error/original