Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,13 +735,13 @@ func ConstructError(statusCode int, b []byte) error {
err.Error.Message = string(b)
}
err.Error.HTTPReturnedStatusCode = statusCode
err.Error.rawData = b
err.Error.RawData = b
return err.Error
}

// Error is redfish error response object for HTTP status codes different from 200, 201 and 204
type Error struct {
rawData []byte
RawData []byte `json:"-"`
// An integer that represents the status code returned by the API
HTTPReturnedStatusCode int `json:"-"`
// A string indicating a specific MessageId from the message registry.
Expand All @@ -754,9 +754,9 @@ type Error struct {

func (e *Error) Error() string {
if e.HTTPReturnedStatusCode != 0 {
return fmt.Sprintf("%d: %s", e.HTTPReturnedStatusCode, e.rawData)
return fmt.Sprintf("%d: %s", e.HTTPReturnedStatusCode, e.RawData)
}
return string(e.rawData)
return string(e.RawData)
}

// ErrExtendedInfo is for redfish ExtendedInfo error response
Expand Down