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

Aberta
#552 8 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
JavaScript
Estrelas
425
Forks
136
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

## 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.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.