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

feat: add NewError function #256

Merged
merged 1 commit into from
Feb 8, 2023
Merged

Conversation

dzakaammar
Copy link

@dzakaammar dzakaammar commented Feb 8, 2023

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
Copy link
Author

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

@nukosuke
Copy link
Owner

nukosuke commented Feb 8, 2023

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
Copy link
Author

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

Copy link
Owner

@nukosuke nukosuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
thanks!

@nukosuke nukosuke merged commit e68b545 into nukosuke:master Feb 8, 2023
@dzakaammar
Copy link
Author

dzakaammar commented Feb 8, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants