From 3f9df4473e6e68afea0f1e46e4a6cf5b4cf8590d Mon Sep 17 00:00:00 2001 From: JAMES ZHANG Date: Wed, 9 Mar 2016 16:32:06 -0600 Subject: [PATCH] update 429 error message --- public/js/demo.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/js/demo.js b/public/js/demo.js index aae1626f..98e5c99e 100755 --- a/public/js/demo.js +++ b/public/js/demo.js @@ -332,10 +332,15 @@ function allReady(thresholds, sampleText) { * @param {Object} error */ function _error(error) { + console.log(error.responseJSON.code); var message = typeof error.responseJSON.error === 'string' ? error.responseJSON.error : 'Error code ' + error.responseJSON.error.code + ': ' + error.responseJSON.error.message; - $errorMessage.text(message); + + if (error.responseJSON.code === 429) + message = 'You\'ve sent a lot of requests in a short amount of time. ' + + 'As the CPU cores cool off a bit, wait a few seonds before sending more requests.' + $errorMessage.html(message); $input.show(); $loading.hide(); $output.hide();