json-api

Handling errors with the (now default) Ember Data JSON-API adapter

柔情痞子 提交于 2019-11-26 10:58:44
问题 I am using Ember 1.13.7 and Ember Data 1.13.8, which by default use the JSON-API standard to format the payloads sent to and received from the API. I would like to use Ember Data\'s built-in error handling in order to display red \"error\" form fields to the user. I have formatted my API error responses as per the JSON-API standard, e.g. {\"errors\":[ { \"title\":\"The included.1.attributes.street name field is required.\", \"code\":\"API_ERR\", \"status\":\"400\", } ]} and when I attempt to