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

fix: normalizeErrorResponse should be resilient to non-string details #8621

Merged
merged 3 commits into from
May 25, 2023

Conversation

NullVoxPopuli
Copy link
Contributor

…e ends up returning [object Object] for "detail"

Description

Found this while debugging an error I was getting from Mirage (500).
It seems Mirage doesn't have a way to serialize errors -- so.. that's fun.
In any case, I think giving a best-effort attempt to show more details for the detail part of the normalizeErrorResponse return object would be beneficial for everyone.

Notes for the release

When 500 errors send an object back to the client, that object will be serialized JSON instead of [object Object]

…e ends up returning [object Object] for "detail"
@runspired runspired added 🎯 beta PR should be backported to beta 🎯 release PR should be backported to release 🎯 canary PR is targeting canary (default) 🎯 lts The PR should be backported to the most recent LTS 🏷️ bug This PR primarily fixes a reported issue lts-4-12 Long Term LTS Maintenance lts-4-8 labels May 25, 2023
@runspired runspired merged commit 387c167 into emberjs:main May 25, 2023
@NullVoxPopuli NullVoxPopuli deleted the patch-1 branch May 25, 2023 18:59
@runspired runspired changed the title There are cases where payload is an object, and normalizeErrorRespons… fix: normalizeErrorResponse should be resilient to non-string details May 25, 2023
runspired pushed a commit that referenced this pull request Jun 10, 2023
#8621)

* There are cases where payload is an object, and normalizeErrorResponse ends up returning [object Object] for "detail"

* Add comment about JSON.stringify

* Update rest.ts
@runspired runspired removed the lts-4-12 Long Term LTS Maintenance label Jun 10, 2023
runspired added a commit that referenced this pull request Jun 10, 2023
* fix: restore Store extends EmberObject :( (#8594)

* fix: restore Store extends EmberObject :(

* fix EmberObject bs

* fix: LegacyHandler should provide unfrozen options to Adapters (resolves #8576)


---------

Co-authored-by: Chris Thoburn <[email protected]>

* fix: dont share promise cache for all fields (#8597)

* fix: docs generation should maintain a stable relative path (#8598)

* docs: fix forgotten references to FetchManager (#8601)

* Avoid unnecessary identity notification when record is saved (#8566)

* Add failing test

* Ignore JetBrains IDE files

* Revise failing test

* Call setRecordId only for new records

* Add (failing) test for updated id from server

* update test

* error when appropriate, thread context to give cache responsibility

* fix lint

---------

Co-authored-by: Chris Thoburn <[email protected]>

* fix backport of identity notification fix

* There are cases where payload is an object, and normalizeErrorRespons… (#8621)

* There are cases where payload is an object, and normalizeErrorResponse ends up returning [object Object] for "detail"

* Add comment about JSON.stringify

* Update rest.ts

---------

Co-authored-by: Maxim <[email protected]>
Co-authored-by: Robby Morgan <[email protected]>
Co-authored-by: NullVoxPopuli <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 beta PR should be backported to beta 🎯 canary PR is targeting canary (default) 🎯 lts The PR should be backported to the most recent LTS 🎯 release PR should be backported to release 🏷️ bug This PR primarily fixes a reported issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants