diff --git a/CHANGELOG.md b/CHANGELOG.md index 57d98cb..fd3c69e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +### Added + +## [1.7.0] - 2024-07-09 + +- Added accessors for headers and status to `ApiErrorable` [#177](https://github.com/microsoft/kiota-abstractions-go/issues/177) + +### Changed + ## [1.6.1] - 2024-07-09 - Corrected two instances of `octet-steam` to `octet-stream` [#173](https://github.com/microsoft/kiota-abstractions-go/pull/173), [#174](https://github.com/microsoft/kiota-abstractions-go/pull/174) diff --git a/api_error.go b/api_error.go index 83f5e17..9fa99b4 100644 --- a/api_error.go +++ b/api_error.go @@ -5,6 +5,8 @@ import "fmt" type ApiErrorable interface { SetResponseHeaders(ResponseHeaders *ResponseHeaders) SetStatusCode(ResponseStatusCode int) + GetResponseHeaders() *ResponseHeaders + GetStatusCode() int } // ApiError is the parent type for errors thrown by the client when receiving failed responses to its requests @@ -34,3 +36,11 @@ func (e *ApiError) SetResponseHeaders(ResponseHeaders *ResponseHeaders) { func (e *ApiError) SetStatusCode(ResponseStatusCode int) { e.ResponseStatusCode = ResponseStatusCode } + +func (e *ApiError) GetResponseHeaders() *ResponseHeaders { + return e.ResponseHeaders +} + +func (e *ApiError) GetStatusCode() int { + return e.ResponseStatusCode +}