Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add Accessors for ApiErrorable #181

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
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: 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
}
Loading