internal/worker: add String to clienterrors.Error struct
This should make the logging better when errors have another error struct. Fixes #3272
This commit is contained in:
parent
5a62453190
commit
96b42b5791
1 changed files with 8 additions and 0 deletions
|
|
@ -1,5 +1,9 @@
|
|||
package clienterrors
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const (
|
||||
ErrorNoDynamicArgs ClientErrorCode = 1
|
||||
ErrorInvalidTargetConfig ClientErrorCode = 2
|
||||
|
|
@ -46,6 +50,10 @@ type Error struct {
|
|||
Details interface{} `json:"details,omitempty"`
|
||||
}
|
||||
|
||||
func (e *Error) String() string {
|
||||
return fmt.Sprintf("Code: %d, Reason: %s, Details: %v", e.ID, e.Reason, e.Details)
|
||||
}
|
||||
|
||||
const (
|
||||
JobStatusSuccess = "2xx"
|
||||
JobStatusUserInputError = "4xx"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue