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

Enhancement/mapi errors #22

Merged
merged 3 commits into from
Apr 9, 2021

Conversation

theflyingcodr
Copy link
Contributor

@theflyingcodr theflyingcodr commented Apr 9, 2021

If an error is received from an MAPI server the client currently just echos a 'status code x does not match status code y' message. This doesn't give us a lot of context to work with when debugging.

This PR resolves Issue #21.

If status is OK then it just returns as before.

If there is a mismatch, we will check we have a body, if we do we attempt to map to an error type and then add the result to the error message. Otherwise we just echo the status code.

Concerns

Do all errors / non 200 status codes have the same error format?

@mrz1836 mrz1836 self-assigned this Apr 9, 2021
@mrz1836 mrz1836 added the update General updates label Apr 9, 2021
Copy link
Member

@mrz1836 mrz1836 left a comment

Choose a reason for hiding this comment

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

Add a return statement in the error case for unmarshall

request.go Show resolved Hide resolved
@theflyingcodr theflyingcodr requested a review from mrz1836 April 9, 2021 14:31
@mrz1836 mrz1836 merged commit 072fa19 into tonicpow:master Apr 9, 2021
@mrz1836 mrz1836 mentioned this pull request Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
update General updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants