Skip to content

Commit

Permalink
fix: Add Accessors for ApiErrorable (#181)
Browse files Browse the repository at this point in the history
* fix: add accessors for ApiErrorable

* Update changelog
  • Loading branch information
rkodev authored Aug 29, 2024
1 parent cb19c41 commit 23ad3d1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions api_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

0 comments on commit 23ad3d1

Please sign in to comment.