Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Commit

Permalink
Merge pull request #84 from watson-developer-cloud/error-message
Browse files Browse the repository at this point in the history
update error message for status 429
  • Loading branch information
germanattanasio committed May 3, 2016
2 parents c410eed + c6909a1 commit 76ebaf3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions public/js/use.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ function setupUse(params) {
var message = 'Error creating the classifier';
if (xhr.responseJSON)
message = xhr.responseJSON.error;

showError(message);
}

Expand Down Expand Up @@ -167,10 +166,14 @@ function setupUse(params) {
// Grab all form data
$.post(url, $(pclass + 'form').serialize())
.done(showResult)
.error(function() {
.error(function(error) {
$loading.hide();
showError('The demo is not available right now. <br/>We are working on ' +
'getting this back up and running soon.');
console.log(error);
if (error.status === 429)
showError('You have entered too many requests at once. Please try again later.');
else
showError('The demo is not available right now. <br/>We are working on ' +
'getting this back up and running soon.');
});
}

Expand Down

0 comments on commit 76ebaf3

Please sign in to comment.