Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __str__(self):
if not self.connection.options['verbose_error']:
return self.message
params = self.get_params_for_print()
pad_length = max(len(x) for x in params)
res = ''
for k in params:
res += (' ' * 4) + k.ljust(pad_length) + ' => ' + params[k] + '\n'
return '\n(\n' + res + ')\n'
class ExaRuntimeError(ExaError):
pass
class ExaCommunicationError(ExaError):
"""
WebSocket communication failure after connection was established
"""
pass
class ExaRequestError(ExaError):
"""
Generic error returned from Exasol server after making a request
"""
def __init__(self, connection, code, message):
self.code = code
class ExaConnectionDsnError(ExaConnectionError):
"""
Specific error for connection failure related to DSN (connection string) issues
"""
pass
class ExaConnectionFailedError(ExaConnectionError):
"""
Specific error related to establishing WebSocket communication
"""
pass
class ExaConcurrencyError(ExaError):
"""
Detected an attempt to run multiple queries in multiple threads at the same time
"""
pass
return '\n(\n' + res + ')\n'
class ExaRuntimeError(ExaError):
pass
class ExaCommunicationError(ExaError):
"""
WebSocket communication failure after connection was established
"""
pass
class ExaRequestError(ExaError):
"""
Generic error returned from Exasol server after making a request
"""
def __init__(self, connection, code, message):
self.code = code
super().__init__(connection, message)
def get_params_for_print(self):
params = super().get_params_for_print()
params['code'] = self.code
return params
class ExaAuthError(ExaRequestError):
params = self.get_params_for_print()
pad_length = max(len(x) for x in params)
res = ''
for k in params:
res += (' ' * 4) + k.ljust(pad_length) + ' => ' + params[k] + '\n'
return '\n(\n' + res + ')\n'
class ExaRuntimeError(ExaError):
pass
class ExaCommunicationError(ExaError):
"""
WebSocket communication failure after connection was established
"""
pass
class ExaRequestError(ExaError):
"""
Generic error returned from Exasol server after making a request
"""
def __init__(self, connection, code, message):
self.code = code
super().__init__(connection, message)
def get_params_for_print(self):
class ExaQueryTimeoutError(ExaQueryError):
"""
Specific error for SQL query reaching QUERY_TIMEOUT and being terminated by server
"""
pass
class ExaQueryAbortError(ExaQueryError):
"""
Specific error for SQL query being aborted with .abort_query() call or KILL STATEMENT
"""
pass
class ExaConnectionError(ExaError):
"""
Generic error for connection failures
"""
pass
class ExaConnectionDsnError(ExaConnectionError):
"""
Specific error for connection failure related to DSN (connection string) issues
"""
pass
class ExaConnectionFailedError(ExaConnectionError):
"""
Specific error related to establishing WebSocket communication