Module taos.error
Python exceptions
Expand source code
# encoding:UTF-8
"""Python exceptions
"""
class Error(Exception):
def __init__(self, msg=None, errno=0xffff):
self.msg = msg
self.errno = errno
self._full_msg = "[0x%04x]: %s" % (self.errno & 0xffff, self.msg)
def __str__(self):
return self._full_msg
class Warning(Exception):
"""Exception raised for important warnings like data truncations while inserting."""
pass
class InterfaceError(Error):
"""Exception raised for errors that are related to the database interface rather than the database itself."""
pass
class DatabaseError(Error):
"""Exception raised for errors that are related to the database."""
pass
class ConnectionError(Error):
"""Exception raised for connection failed"""
pass
class DataError(DatabaseError):
"""Exception raised for errors that are due to problems with the processed data like division by zero, numeric value out of range."""
pass
class OperationalError(DatabaseError):
"""Exception raised for errors that are related to the database's operation and not necessarily under the control of the programmer"""
pass
class IntegrityError(DatabaseError):
"""Exception raised when the relational integrity of the database is affected."""
pass
class InternalError(DatabaseError):
"""Exception raised when the database encounters an internal error."""
pass
class ProgrammingError(DatabaseError):
"""Exception raised for programming errors."""
pass
class NotSupportedError(DatabaseError):
"""Exception raised in case a method or database API was used which is not supported by the database,."""
pass
class StatementError(DatabaseError):
"""Exception raised in STMT API."""
pass
class ResultError(DatabaseError):
"""Result related APIs."""
pass
class SchemalessError(DatabaseError):
"""taos_schemaless_insert errors."""
def __init__(self, msg=None, errno=0xffff, affected_rows=0):
DatabaseError.__init__(self, msg, errno)
self.affected_rows = affected_rows
def __str__(self):
return self._full_msg + "(affected rows: %d)" % self.affected_rows
# @property
# def affected_rows(self):
# return self.affected_rows
class StatementError(DatabaseError):
"""Exception raised in STMT API."""
pass
class ResultError(DatabaseError):
"""Result related APIs."""
pass
class LinesError(DatabaseError):
"""taos_insert_lines errors."""
pass
class TmqError(DatabaseError):
"""Execption raise in TMQ API"""
pass
Classes
class ConnectionError (msg=None, errno=65535)
-
Exception raised for connection failed
Expand source code
class ConnectionError(Error): """Exception raised for connection failed""" pass
Ancestors
- Error
- builtins.Exception
- builtins.BaseException
class DataError (msg=None, errno=65535)
-
Exception raised for errors that are due to problems with the processed data like division by zero, numeric value out of range.
Expand source code
class DataError(DatabaseError): """Exception raised for errors that are due to problems with the processed data like division by zero, numeric value out of range.""" pass
Ancestors
- DatabaseError
- Error
- builtins.Exception
- builtins.BaseException
class DatabaseError (msg=None, errno=65535)
-
Exception raised for errors that are related to the database.
Expand source code
class DatabaseError(Error): """Exception raised for errors that are related to the database.""" pass
Ancestors
- Error
- builtins.Exception
- builtins.BaseException
Subclasses
class Error (msg=None, errno=65535)
-
Common base class for all non-exit exceptions.
Expand source code
class Error(Exception): def __init__(self, msg=None, errno=0xffff): self.msg = msg self.errno = errno self._full_msg = "[0x%04x]: %s" % (self.errno & 0xffff, self.msg) def __str__(self): return self._full_msg
Ancestors
- builtins.Exception
- builtins.BaseException
Subclasses
class IntegrityError (msg=None, errno=65535)
-
Exception raised when the relational integrity of the database is affected.
Expand source code
class IntegrityError(DatabaseError): """Exception raised when the relational integrity of the database is affected.""" pass
Ancestors
- DatabaseError
- Error
- builtins.Exception
- builtins.BaseException
class InterfaceError (msg=None, errno=65535)
-
Exception raised for errors that are related to the database interface rather than the database itself.
Expand source code
class InterfaceError(Error): """Exception raised for errors that are related to the database interface rather than the database itself.""" pass
Ancestors
- Error
- builtins.Exception
- builtins.BaseException
class InternalError (msg=None, errno=65535)
-
Exception raised when the database encounters an internal error.
Expand source code
class InternalError(DatabaseError): """Exception raised when the database encounters an internal error.""" pass
Ancestors
- DatabaseError
- Error
- builtins.Exception
- builtins.BaseException
class LinesError (msg=None, errno=65535)
-
taos_insert_lines errors.
Expand source code
class LinesError(DatabaseError): """taos_insert_lines errors.""" pass
Ancestors
- DatabaseError
- Error
- builtins.Exception
- builtins.BaseException
class NotSupportedError (msg=None, errno=65535)
-
Exception raised in case a method or database API was used which is not supported by the database,.
Expand source code
class NotSupportedError(DatabaseError): """Exception raised in case a method or database API was used which is not supported by the database,.""" pass
Ancestors
- DatabaseError
- Error
- builtins.Exception
- builtins.BaseException
class OperationalError (msg=None, errno=65535)
-
Exception raised for errors that are related to the database's operation and not necessarily under the control of the programmer
Expand source code
class OperationalError(DatabaseError): """Exception raised for errors that are related to the database's operation and not necessarily under the control of the programmer""" pass
Ancestors
- DatabaseError
- Error
- builtins.Exception
- builtins.BaseException
class ProgrammingError (msg=None, errno=65535)
-
Exception raised for programming errors.
Expand source code
class ProgrammingError(DatabaseError): """Exception raised for programming errors.""" pass
Ancestors
- DatabaseError
- Error
- builtins.Exception
- builtins.BaseException
class ResultError (msg=None, errno=65535)
-
Result related APIs.
Expand source code
class ResultError(DatabaseError): """Result related APIs.""" pass
Ancestors
- DatabaseError
- Error
- builtins.Exception
- builtins.BaseException
class SchemalessError (msg=None, errno=65535, affected_rows=0)
-
taos_schemaless_insert errors.
Expand source code
class SchemalessError(DatabaseError): """taos_schemaless_insert errors.""" def __init__(self, msg=None, errno=0xffff, affected_rows=0): DatabaseError.__init__(self, msg, errno) self.affected_rows = affected_rows def __str__(self): return self._full_msg + "(affected rows: %d)" % self.affected_rows # @property # def affected_rows(self): # return self.affected_rows
Ancestors
- DatabaseError
- Error
- builtins.Exception
- builtins.BaseException
class StatementError (msg=None, errno=65535)
-
Exception raised in STMT API.
Expand source code
class StatementError(DatabaseError): """Exception raised in STMT API.""" pass
Ancestors
- DatabaseError
- Error
- builtins.Exception
- builtins.BaseException
class TmqError (msg=None, errno=65535)
-
Execption raise in TMQ API
Expand source code
class TmqError(DatabaseError): """Execption raise in TMQ API""" pass
Ancestors
- DatabaseError
- Error
- builtins.Exception
- builtins.BaseException
class Warning (*args, **kwargs)
-
Exception raised for important warnings like data truncations while inserting.
Expand source code
class Warning(Exception): """Exception raised for important warnings like data truncations while inserting.""" pass
Ancestors
- builtins.Exception
- builtins.BaseException