def raise_error(self, exception_type, url=None, method=None, error=None, details=None):
    if error:
        error = str(error)
    output = ' '.join(([self.id] + [var for var in (url, method, error, details) if (var is not None)]))
    raise exception_type(output)
def raise_error(self, exception_type, url=None, method=None, error=None, details=None):
    if error:
        error = str(error)
    output = ' '.join(([self.id] + [var for var in (url, method, error, details) if (var is not None)]))
    raise exception_type(output)