psu/client/errors.go
2019-08-26 09:10:28 -04:00

17 lines
326 B
Go

package client
import "fmt"
// GenericError represents the body of a generic error returned by the Portainer API
type GenericError struct {
Err string
Details string
}
func (e *GenericError) Error() string {
if e.Details != "" {
return fmt.Sprintf("%s: %s", e.Err, e.Details)
}
return fmt.Sprintf("%s", e.Err)
}