diff --git a/lib/client/client.js b/lib/client/client.js index e1c0cd0..429424a 100644 --- a/lib/client/client.js +++ b/lib/client/client.js @@ -182,10 +182,14 @@ AccountsTemplates.submitCallback = function(error, state, onSuccess) { AccountsTemplates.state.form.set('error', errorsWithoutField); } } else { - // If error.details is an object, we may try to set fields errors from it - _.each(error.details, function(error, fieldId) { - AccountsTemplates.getField(fieldId).setError(error); - }); + if (error.error == 'too-many-requests') { + AccountsTemplates.state.form.set('error', [error.reason]); + } else { + // If error.details is an object, we may try to set fields errors from it + _.each(error.details, function (error, fieldId) { + AccountsTemplates.getField(fieldId).setError(error); + }); + } } } else { var err = 'error.accounts.Unknown error';