FIX: uses localized string for 429 in reports (#6302)

NGINX was retuning an html page instead of single string for some users. Seems safer to not risk showing anything from server anyways.
This commit is contained in:
Joffrey JAFFEUX 2018-08-22 18:13:29 +02:00 committed by GitHub
parent c08dea386b
commit a48059fd8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

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

View File

@ -2808,6 +2808,7 @@ en:
disabled: Disabled
timeout_error: Sorry, query is taking too long, please pick a shorter interval
exception_error: Sorry, an error occurred while executing the query
too_many_requests: Youve performed this action too many times. Please wait before trying again.
reports:
trend_title: "%{percent} change. Currently %{current}, was %{prev} in previous period."