2019-09-19 16:49:55 +03:00
|
|
|
package redfish
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2020-03-09 22:00:10 +00:00
|
|
|
|
2019-12-01 14:14:09 +04:00
|
|
|
aerror "opendev.org/airship/airshipctl/pkg/errors"
|
2019-09-19 16:49:55 +03:00
|
|
|
)
|
|
|
|
|
2020-03-17 15:35:02 +00:00
|
|
|
// ErrRedfishClient describes an error encountered by the go-redfish client.
|
|
|
|
type ErrRedfishClient struct {
|
2019-09-19 16:49:55 +03:00
|
|
|
aerror.AirshipError
|
2020-03-17 15:35:02 +00:00
|
|
|
Message string
|
2019-09-19 16:49:55 +03:00
|
|
|
}
|
|
|
|
|
2020-03-17 15:35:02 +00:00
|
|
|
func (e ErrRedfishClient) Error() string {
|
|
|
|
return fmt.Sprintf("redfish client encountered an error: %s", e.Message)
|
2019-09-19 16:49:55 +03:00
|
|
|
}
|
|
|
|
|
2020-03-17 15:35:02 +00:00
|
|
|
// ErrRedfishMissingConfig describes an error encountered due to a missing configuration option.
|
2020-02-11 11:54:18 -05:00
|
|
|
type ErrRedfishMissingConfig struct {
|
|
|
|
What string
|
2019-09-19 16:49:55 +03:00
|
|
|
}
|
|
|
|
|
2020-02-11 11:54:18 -05:00
|
|
|
func (e ErrRedfishMissingConfig) Error() string {
|
|
|
|
return "missing configuration: " + e.What
|
2019-09-19 16:49:55 +03:00
|
|
|
}
|
|
|
|
|
2020-03-16 14:14:04 +04:00
|
|
|
// ErrOperationRetriesExceeded raised if number of operation retries exceeded
|
|
|
|
type ErrOperationRetriesExceeded struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e ErrOperationRetriesExceeded) Error() string {
|
|
|
|
return "maximum retries exceeded"
|
|
|
|
}
|