Documentation ¶
Index ¶
- func ArgStringD(arg, def string) string
- func ErrorsBesidesRecordNotFound(errs []error) bool
- func ErrorsToError(errs []error) error
- func ErrorsToString(errs []error) string
- func ErrorsToStrings(errs []error) []string
- func ExitError(err error)
- func ExitErrors(errs []error)
- func ExitSuccess()
- func IsNotFoundError(err error) bool
- func PrependErrors(errs []error, err error) []error
- func RecordNotFound(errs []error) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgStringD ¶
func ErrorsBesidesRecordNotFound ¶ added in v0.1.29
Returns true if there are any errors in the provided array that are NOT a GORM "record not found" error.
func ErrorsToError ¶ added in v0.1.29
func ErrorsToString ¶ added in v0.1.29
func ErrorsToStrings ¶ added in v0.1.29
func ExitErrors ¶ added in v0.1.29
func ExitErrors(errs []error)
func ExitSuccess ¶ added in v0.1.29
func ExitSuccess()
func IsNotFoundError ¶ added in v0.1.30
Returns true if the provided error is the GORM "record not found" error. Note that this function only returns true on exact matches, so wrapped or flattened errors containing the "record not found" error will not be caught. Given that the GORM "record not found" error is rather generic, handling those cases is too likely to result in false positives. For this reason, the check should be performed before wrapping or flattening any GORM errors using the other helper functions in this file.
func PrependErrors ¶ added in v0.1.29
func RecordNotFound ¶ added in v0.1.29
Returns true if the provided slice of errors contains a GORM "record not found" error.
Types ¶
This section is empty.