Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
justeat#330: Adding new ErrorWithMessageResponse object to handle err…
…or with object body We received two different error message formats. one: { "error": "Couldn't authenticate you" } two: { "error": { "title": "Forbidden", "message": "You do not have access to this page. Please contact the account owner of this help desk for further help." } } The current ErrorResponse model class was able to handle the first response but would throw this error with the second response: "Unexpected character encountered while parsing value: {. Path 'error', line 2, position 12" because it's expecting a string value for error but instead it hits a complex object . The new ErrorWithMessageResponse model class will allow the user to deserialize the second response and convert it to an ErrorResponse object.
- Loading branch information