errors

package
v0.0.0-...-a142604 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2017 License: MIT Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoMasterConn  = errors.New("no master connection")
	ErrNoSlaveConn   = errors.New("no slave connection")
	ErrNoDefaultNode = errors.New("no default node")
	ErrNoMasterDB    = errors.New("no master database")
	ErrNoSlaveDB     = errors.New("no slave database")
	ErrNoDatabase    = errors.New("no database")
	ErrNoIdleConn    = errors.New("exceed max conn num")

	ErrNoDataHost = errors.New("no data host")
	ErrNoDataNode = errors.New("no data node")
	ErrNoSchema   = errors.New("no schema")
	ErrNoTable    = errors.New("no table")

	ErrNoRouteNode = errors.New("no route node")
	ErrNoPlan      = errors.New("statement have no plan")
	ErrNoStatement = errors.New("no statement to execute")

	ErrSchemaNotExists   = errors.New("schema not exists")
	ErrDatabaseNotExists = errors.New("database not exists")
	ErrTableNotExists    = errors.New("table not exists")

	ErrMasterDown    = errors.New("master is down")
	ErrSlaveDown     = errors.New("slave is down")
	ErrDatabaseClose = errors.New("database is close")
	ErrConnIsNil     = errors.New("connection is nil")
	ErrBadConn       = errors.New("connection was bad")
	ErrIgnoreSQL     = errors.New("ignore this sql")

	ErrAddressNull     = errors.New("address is nil")
	ErrInvalidArgument = errors.New("argument is invalid")
	ErrInvalidCharset  = errors.New("charset is invalid")
	ErrCmdUnsupport    = errors.New("command unsupport")

	ErrSelectInInsert   = errors.New("select in insert not allowed")
	ErrTransInMulti     = errors.New("transaction in multi node")
	ErrExecInMulti      = errors.New("execute in multi node")
	ErrColsLenNotMatch  = errors.New("insert or replace cols and values length not match")
	ErrInsertColumnsKey = errors.New("no shard key in insert column list")
	ErrInsertValuesKey  = errors.New("no shard key or key has different values in insert values list")
	ErrUpdateKey        = errors.New("shard key in update expression")
	ErrWhereOrJoinOnKey = errors.New("no shard key or key has different values in where or join on expression")

	ErrMustPositiveIntegerInModShard = errors.New("shard key must positive integer when use mod shard algorithm")

	ErrStmtConvert      = errors.New("statement fail to convert")
	ErrExprConvert      = errors.New("expr fail to convert")
	ErrConnNotEqual     = errors.New("the length of conns not equal sqls")
	ErrKeyOutOfRange    = errors.New("shard key not in key range")
	ErrDateIllegal      = errors.New("date format illegal")
	ErrDateRangeIllegal = errors.New("date range format illegal")
	ErrDateRangeCount   = errors.New("date range count is not equal")
	ErrSlaveExist       = errors.New("slave has exist")
	ErrSlaveNotExist    = errors.New("slave has not exist")

	ErrMalformPacket = errors.New("Malform packet error")
	ErrTxDone        = errors.New("Transaction has already been committed or rolled back")
)

Functions

func New

func New(text string) error

New returns an error that formats as the given text.

Types

type SqlError

type SqlError struct {
	Code    uint16
	Message string
	State   string
}

func (*SqlError) Error

func (e *SqlError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL