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

AdapterError generatedDetailedMessage should handle JSON payloads #4953

Closed
urbany opened this issue Apr 28, 2017 · 2 comments
Closed

AdapterError generatedDetailedMessage should handle JSON payloads #4953

urbany opened this issue Apr 28, 2017 · 2 comments

Comments

@urbany
Copy link

urbany commented Apr 28, 2017

Hi,

When I get a JSONAPI error from the API I see this message:

Ember Data Request PATCH /api/professionals/1044 returned a 403
Payload (Empty Content-Type)
[object Object]

The [object Object] is the payload. Maybe there is a better way of showing this since [object Object] is not very helpful.

This message is generated here:

shortenedPayload = payload;

In my case I'm using JSONAPI, since the error format is known, maybe we can parse the error?

Or just JSON.stringify(payload) ?

This would be very useful for people that use services like sentry.io. I'm going to override these locally for now, but would like to know what you think of this.

Thanks in advance for your inputs!

@bmac
Copy link
Member

bmac commented May 10, 2017

Sounds like a good change to me. @urbany would you like to open a pr for this change?

@urbany
Copy link
Author

urbany commented May 10, 2017

Sure, I just don't know how to create a test for it, which I imagine would be needed for the PR.
Anyway do you think the best option is to stringify the payload and truncate it (in case it's a big payload) Or look at any of the attributes returned in the JSONAPI errors object?

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

No branches or pull requests

3 participants