From d1d33043a23954870fc0eac05fe1c4900b99abd0 Mon Sep 17 00:00:00 2001 From: Sanford Miller Date: Tue, 7 Jul 2026 12:35:02 -0400 Subject: [PATCH] feat: export Error.rawData field --- common/types.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/types.go b/common/types.go index f987d6b7..7e01366e 100644 --- a/common/types.go +++ b/common/types.go @@ -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. @@ -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