nukosuke / go-zendesk

Zendesk API client library for Go
https://pkg.go.dev/github.com/nukosuke/go-zendesk/zendesk
MIT License
62 stars 81 forks source link

feat: add NewError function #256

Closed dzakaammar closed 1 year ago

dzakaammar commented 1 year ago

Since every errors from each API will be wrapped by the Error type. Here i add a new function to initialize the Error type publicly. Typically, this function will be useful for unit testing and mocking purposes in the client side to test their behavior by the API response.

dzakaammar commented 1 year ago

hi @nukosuke kindly review this PR ya. thank you :)

nukosuke commented 1 year ago

this function will be useful for unit testing and mocking purposes in the client side to test their behavior by the API response.

Might want to add this commentary to doc comment to explain why the constructor of API error is exposed.

dzakaammar commented 1 year ago

@nukosuke sure, I just update the comment. thank you

dzakaammar commented 1 year ago

thanks @nukosuke, it would be nice if you could create tag for it :)