I’m doing something using different apis in jquery terminal but, If the user makes a mistake, the error message looks like this
code:
gemini: function(a){
$.ajaxSetup({async: false});
$.get('https://api.github.com/repos/'+a, function(x){
b = x.name;
c = x.id;
d = x.license.name;
e = x.svn_url;
});
this.echo('name: '+b);
this.echo('id: '+c);
this.echo('license: '+d)
this.echo('.zip: '+e+'/archive/master.zip');
},
My question is how can I send a small message in a possible error.
2
Answers
javascript still needs the
async
await
code to wait for the result of the data request.fetch
code is available in browser to replace jqueryThe exception is nice because you can easily find where the error happens, but if you want to hide it then you have
exceptionHandler
option that you can use just for that. But note that if you have a Promise you need to return it otherwise the terminal will not see the rejection of that promise.And it seems that the label is wrong, [Command] means that it was an internal error, but it was a user error only from a rejected promise.