You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.6 KiB
52 lines
1.6 KiB
8 years ago
|
// 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"
|
||
6 years ago
|
"fmt"
|
||
8 years ago
|
)
|
||
|
|
||
|
var (
|
||
8 years ago
|
// ErrParamsType params error
|
||
|
ErrParamsType = errors.New("Params type error")
|
||
|
// ErrTableNotFound table not found error
|
||
6 years ago
|
ErrTableNotFound = errors.New("Table not found")
|
||
8 years ago
|
// ErrUnSupportedType unsupported error
|
||
|
ErrUnSupportedType = errors.New("Unsupported type error")
|
||
6 years ago
|
// ErrNotExist record does not exist error
|
||
|
ErrNotExist = errors.New("Record does not exist")
|
||
8 years ago
|
// ErrCacheFailed cache failed error
|
||
|
ErrCacheFailed = errors.New("Cache failed")
|
||
|
// ErrNeedDeletedCond delete needs less one condition error
|
||
6 years ago
|
ErrNeedDeletedCond = errors.New("Delete action needs at least one condition")
|
||
8 years ago
|
// ErrNotImplemented not implemented
|
||
|
ErrNotImplemented = errors.New("Not implemented")
|
||
7 years ago
|
// ErrConditionType condition type unsupported
|
||
6 years ago
|
ErrConditionType = errors.New("Unsupported condition type")
|
||
5 years ago
|
// ErrUnSupportedSQLType parameter of SQL is not supported
|
||
|
ErrUnSupportedSQLType = errors.New("unsupported sql type")
|
||
8 years ago
|
)
|
||
6 years ago
|
|
||
|
// 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)
|
||
|
}
|