2022-12-26 03:45:21 -06:00
|
|
|
// Copyright 2015 The Xorm Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package xorm
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
// ErrParamsType params error
|
2022-12-26 08:39:21 -06:00
|
|
|
ErrParamsType = errors.New("params type error")
|
2022-12-26 03:45:21 -06:00
|
|
|
// ErrTableNotFound table not found error
|
2022-12-26 08:39:21 -06:00
|
|
|
ErrTableNotFound = errors.New("table not found")
|
2022-12-26 03:45:21 -06:00
|
|
|
// ErrUnSupportedType unsupported error
|
2022-12-26 08:39:21 -06:00
|
|
|
ErrUnSupportedType = errors.New("unsupported type error")
|
2022-12-26 03:45:21 -06:00
|
|
|
// ErrNotExist record does not exist error
|
2022-12-26 08:39:21 -06:00
|
|
|
ErrNotExist = errors.New("record does not exist")
|
2022-12-26 03:45:21 -06:00
|
|
|
// ErrCacheFailed cache failed error
|
2022-12-26 08:39:21 -06:00
|
|
|
ErrCacheFailed = errors.New("cache failed")
|
2022-12-26 03:45:21 -06:00
|
|
|
// ErrNeedDeletedCond delete needs less one condition error
|
2022-12-26 08:39:21 -06:00
|
|
|
ErrNeedDeletedCond = errors.New("delete action needs at least one condition")
|
2022-12-26 03:45:21 -06:00
|
|
|
// ErrNotImplemented not implemented
|
2022-12-26 08:39:21 -06:00
|
|
|
ErrNotImplemented = errors.New("not implemented")
|
2022-12-26 03:45:21 -06:00
|
|
|
// ErrConditionType condition type unsupported
|
2022-12-26 08:39:21 -06:00
|
|
|
ErrConditionType = errors.New("unsupported condition type")
|
2022-12-26 03:45:21 -06:00
|
|
|
// ErrUnSupportedSQLType parameter of SQL is not supported
|
2022-12-26 08:39:21 -06:00
|
|
|
ErrUnSupportedSQLType = errors.New("unsupported sql type")
|
2022-12-26 03:45:21 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
// ErrFieldIsNotExist columns does not exist
|
|
|
|
type ErrFieldIsNotExist struct {
|
|
|
|
FieldName string
|
|
|
|
TableName string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e ErrFieldIsNotExist) Error() string {
|
|
|
|
return fmt.Sprintf("field %s is not valid on table %s", e.FieldName, e.TableName)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrFieldIsNotValid is not valid
|
|
|
|
type ErrFieldIsNotValid struct {
|
|
|
|
FieldName string
|
|
|
|
TableName string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e ErrFieldIsNotValid) Error() string {
|
|
|
|
return fmt.Sprintf("field %s is not valid on table %s", e.FieldName, e.TableName)
|
|
|
|
}
|