mirror of
https://github.com/jimeh/go-midjourney.git
synced 2026-02-19 09:56:41 +00:00
24 lines
370 B
Go
24 lines
370 B
Go
package midjourney
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type ResponseError struct {
|
|
Message string `json:"error,omitempty"`
|
|
message string
|
|
}
|
|
|
|
func (re *ResponseError) Error() string {
|
|
if re.message != "" {
|
|
return re.message
|
|
}
|
|
re.message = fmt.Errorf("%w: %s", ErrResponse, re.Message).Error()
|
|
|
|
return re.message
|
|
}
|
|
|
|
func (re *ResponseError) Unwrap() error {
|
|
return ErrResponse
|
|
}
|