-
Notifications
You must be signed in to change notification settings - Fork 7
/
errors.go
29 lines (23 loc) · 909 Bytes
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2022 The Moov Authors
// Use of this source code is governed by an Apache License
// license that can be found in the LICENSE file.
package fincen
import (
"fmt"
)
// NewErrTextLength returns an error that the length of value is invalid
func NewErrValueInvalid(typeStr string) error {
return fmt.Errorf("The %s has invalid value", typeStr)
}
// NewErrFieldRequired returns an error when a field is required
func NewErrFieldRequired(typeStr string) error {
return fmt.Errorf("The %s is a required field", typeStr)
}
// NewErrFiledOmitted returns an error that the field should be omitted
func NewErrFiledOmitted(typeStr string) error {
return fmt.Errorf("The %s should be omitted", typeStr)
}
// NewErrMinMaxRange returns an error that the field has min/max element range
func NewErrMinMaxRange(typeStr string) error {
return fmt.Errorf("The %s has invalid min & max range", typeStr)
}