Create ODataError in Non-Success responses - #2341
Merged
Merged
Conversation
xuzhg
reviewed
Nov 3, 2020
Member
|
@KenitoInc Thanks for your PR, Yes, it's based on our discussion. However, i'd like to re-think it again. |
xuzhg
reviewed
Dec 3, 2020
xuzhg
reviewed
Dec 3, 2020
xuzhg
reviewed
Dec 3, 2020
xuzhg
reviewed
Dec 3, 2020
xuzhg
reviewed
Dec 3, 2020
xuzhg
reviewed
Dec 3, 2020
xuzhg
reviewed
Dec 3, 2020
xuzhg
reviewed
Dec 3, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
| // Arrange | ||
| #if NETCORE | ||
| const string expectedResponse = "{\"error\":{\"code\":\"400\",\"message\":\"Update failed\"}}"; | ||
| #else |
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
xuzhg
reviewed
Dec 9, 2020
KenitoInc
marked this pull request as ready for review
December 11, 2020 18:30
KenitoInc
force-pushed
the
fix/2331-odata-error-patch
branch
from
December 16, 2020 13:16
fc92090 to
ec8ae2a
Compare
2 tasks
xuzhg
pushed a commit
that referenced
this pull request
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues
This pull request fixes issue #2331 .
Description
When we return error messages from the controller e.g
The
Error Messageis serialized as a string and the response is as follows:{ "@odata.context":"https://ServiceUri/odata/$metadata#Edm.String", "value":"Error Message" }In this PR, we add Custom methods in the
ODataControllerthat allows us to Create anODataErrorfrom theError Messagehence the response will be Serialized as an Error to achieve the response below:{ "error": { "code": "400", "message": "Error Message" } }Checklist (Uncheck if it is not completed)
Additional work necessary
If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.