mirror of
https://github.com/thegeeklab/wp-plugin-go.git
synced 2024-11-25 09:30:39 +00:00
Add errors.ExitMessagef
This commit is contained in:
parent
d945fc6a48
commit
e4701dca7e
@ -36,7 +36,7 @@ func (e ExitError) Fields() logrus.Fields {
|
|||||||
return e.fields
|
return e.fields
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExitMessage initiales a new ExitCoder implementation.
|
// ExitMessage initializes a new ExitCoder implementation.
|
||||||
func ExitMessage(message interface{}) ExitError {
|
func ExitMessage(message interface{}) ExitError {
|
||||||
return ExitError{
|
return ExitError{
|
||||||
message: message,
|
message: message,
|
||||||
@ -44,7 +44,15 @@ func ExitMessage(message interface{}) ExitError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithFields initiales a new ExitCoder implementation.
|
// ExitMessagef initializes a new ExitCoder implementation.
|
||||||
|
func ExitMessagef(format string, a ...interface{}) ExitError {
|
||||||
|
return ExitError{
|
||||||
|
message: fmt.Errorf(format, a...),
|
||||||
|
code: 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithFields initializes a new ExitCoder implementation.
|
||||||
func WithFields(message interface{}, fields logrus.Fields) ExitError {
|
func WithFields(message interface{}, fields logrus.Fields) ExitError {
|
||||||
return ExitError{
|
return ExitError{
|
||||||
message: message,
|
message: message,
|
||||||
|
Loading…
Reference in New Issue
Block a user