Skip to content

Remove statuses package, use built in http.STATUS_CODES #26

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

Merged
merged 1 commit into from
Oct 11, 2021

Conversation

HappyZombies
Copy link
Member

@HappyZombies HappyZombies commented Oct 11, 2021

This PR simply removes the statuses dependency from the module and uses the built in

The http.STATUS_CODES object has been a part of Node since the beginning, since v0.1.22 actually, so this should not affect backwards combability.

The statuses package was only being used in the OAuthError class (lib/errors/oauth-error.js). The OAuthError class takes two properties, first being either a message or an Error object instance, while the second property can support taking a "code" along with a few other properties (read more in the docs about this class).

Anyways, if the second property did not contain anything, it will default to the value of {code: 500}, and then it will access the http.STATUS_CODES to retrieve the message for this error to then attach it to the custom OAuthError object.

This addresses and resolves #21

@HappyZombies HappyZombies changed the title Remove statuses package, use built http.STATUS_CODES Remove statuses package, use built in http.STATUS_CODES Oct 11, 2021
@HappyZombies
Copy link
Member Author

FYI -- this will make #9 invalid and be closed once this is approved.

@HappyZombies HappyZombies removed the request for review from jwerre October 11, 2021 14:40
Copy link
Member

@jankapunkt jankapunkt left a comment

Choose a reason for hiding this comment

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

looks good no issues here

@jankapunkt
Copy link
Member

@HappyZombies you can take a second look and merge if you like

@HappyZombies HappyZombies merged commit 4d893e4 into development Oct 11, 2021
@HappyZombies HappyZombies deleted the feature.http-status branch October 12, 2021 12:21
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