OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
heavydb.exceptions Namespace Reference

Classes

class  Warning
 
class  Error
 
class  InterfaceError
 
class  DatabaseError
 
class  DataError
 
class  OperationalError
 
class  IntegrityError
 
class  InternalError
 
class  ProgrammingError
 
class  NotSupportedError
 

Functions

def _translate_exception
 

Detailed Description

Define exceptions as specified by the DB API 2.0 spec.

Includes some helper methods for translating thrift
exceptions to the ones defined here.

Function Documentation

def heavydb.exceptions._translate_exception (   e)
private
Translate a thrift-land exception to a DB-API 2.0
exception.

Definition at line 54 of file exceptions.py.

Referenced by heavydb.cursor.Cursor.execute().

54 
56  # type: (Exception) -> Exception
57  """Translate a thrift-land exception to a DB-API 2.0
58  exception.
59  """
60  # TODO: see if there's a way to get error codes, rather than relying msgs
61  if not isinstance(e, TDBException):
62  return e
63  if 'SQL Error' in e.error_msg:
64  err = ProgrammingError
65  else:
66  err = Error
67  return err(e.error_msg)

+ Here is the caller graph for this function: