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

Error Abstraction #22

Open
devnote-dev opened this issue Dec 18, 2022 · 1 comment
Open

Error Abstraction #22

devnote-dev opened this issue Dec 18, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@devnote-dev
Copy link
Member

Abstracting errors to their own classes is a popular and common error structure in a lot of libraries and is a standard in certain programming languages like Java. Currently, PteroJS groups all API errors under PteroAPIError, following this structure we would abstract PteroAPIError and have AuthorizationError for 401/403 responses, ValidationError will extend this for 422 responses, and a series of other error classes for various parts of the API.

Thoughts?

@devnote-dev devnote-dev added the enhancement New feature or request label Dec 18, 2022
@WeeskyBDW
Copy link

WeeskyBDW commented Jan 24, 2023

I agree, that would be great and better for catching (can have custom error messages)

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

No branches or pull requests

2 participants