FIX: handle rate limiting from nginx (#6300)

This commit is contained in:
Joffrey JAFFEUX 2018-08-22 13:10:57 +02:00 committed by GitHub
parent 87d443f070
commit 774e6bc795
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -318,7 +318,10 @@ export default Ember.Component.extend({
})
.catch(data => {
if (data.jqXHR && data.jqXHR.status === 429) {
const error = data.jqXHR.responseJSON.errors[0];
const error = data.jqXHR.responseJSON
? data.jqXHR.responseJSON.errors[0]
: data.jqXHR.responseText;
this.set("rateLimitationString", error);
}
})