adopted-ember-addons / adopted-ember-addons/ember-changeset

Type-Error thrown when a JSON-API server responds with a 406 error and an error body

Aperta
#552 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
425
Fork
136
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Version

3.9.2

## Test Case

Sorry, don't have a test case for this

## Steps to reproduce

When saving a changeset, have a server respond with a 406 error response and the following body:
```
{
errors: [
{
title: 'Well excuse me',
detail: 'Error creating the thing you wanted.'
}
]
}
```

## Expected Behavior

I expect the Ember Data exception to be passed to my `catch()`rather than a type-error from ember-changeset

## Actual Behavior

ember-changeset throws a `TypeError`:

`TypeError: Cannot convert undefined or null to object`, and it is impossible to get the original error back from Ember Data. Instead, I have to pull all the information out of the `changeset.snapshot().changes` object, save them to the model manually, and save the model in order to get the Ember Data exception.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.