Skip to content

Exact Error Codes for Error Collections #388

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
Aug 29, 2018

Conversation

rtablada
Copy link
Contributor

FEATURE

  • write tests that address the requirements outlined in the issue

This change makes it so that error collections will send a status based on the status code of all items in the collection.

If the items in the collection have the same status code, then it return the status code of the entire collection.

If not, it will return 500 or 400 as before.

Copy link
Contributor

@jaredcnance jaredcnance left a comment

Choose a reason for hiding this comment

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

Thanks!


// Add 4xx error not 422
errors.Add(new Error(401, "Unauthorized"));
Assert.Equal(400, exception.GetStatusCode());
Copy link
Contributor

Choose a reason for hiding this comment

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

yeeeesssss

@jaredcnance jaredcnance merged commit 46fcc98 into json-api-dotnet:master Aug 29, 2018
@rtablada
Copy link
Contributor Author

@jaredNance what would be the timeline for this to be released?

@rtablada
Copy link
Contributor Author

Is master the 3.0 beta or stil 2.5.1+?

If we could back port this and cut a 2.5.2 that would be ❤️

@jaredcnance
Copy link
Contributor

@rtablada yes, and yes I will port this to a 2.5.2 release tonight

@jaredcnance
Copy link
Contributor

Change has been backported to 2.5.2. Let me know if you run into any issues with that release.

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

Successfully merging this pull request may close these issues.

3 participants