vikunja-api/vendor/xorm.io/xorm/error.go

52 lines
1.6 KiB
Go
Raw Normal View History

2018-06-10 11:11:41 +02: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"
2019-03-29 18:54:35 +01:00
"fmt"
2018-06-10 11:11:41 +02:00
)
var (
// ErrParamsType params error
ErrParamsType = errors.New("Params type error")
// ErrTableNotFound table not found error
2019-03-29 18:54:35 +01:00
ErrTableNotFound = errors.New("Table not found")
2018-06-10 11:11:41 +02:00
// ErrUnSupportedType unsupported error
ErrUnSupportedType = errors.New("Unsupported type error")
2019-03-29 18:54:35 +01:00
// ErrNotExist record does not exist error
ErrNotExist = errors.New("Record does not exist")
2018-06-10 11:11:41 +02:00
// ErrCacheFailed cache failed error
ErrCacheFailed = errors.New("Cache failed")
// ErrNeedDeletedCond delete needs less one condition error
2019-03-29 18:54:35 +01:00
ErrNeedDeletedCond = errors.New("Delete action needs at least one condition")
2018-06-10 11:11:41 +02:00
// ErrNotImplemented not implemented
ErrNotImplemented = errors.New("Not implemented")
2019-03-29 18:54:35 +01:00
// ErrConditionType condition type unsupported
ErrConditionType = errors.New("Unsupported condition type")
// ErrUnSupportedSQLType parameter of SQL is not supported
ErrUnSupportedSQLType = errors.New("unsupported sql type")
2018-06-10 11:11:41 +02:00
)
2019-03-29 18:54:35 +01: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)
}