Closed emjunior258 closed 8 years ago
The best way to catch exceptions globally is to set a message on the promise to be exhibited by the global handler. The global handler receives the promise as first argument to be
Frontier1.getFullName("Mario", "Junior")
.try(function (data) {
console.log(data);
}).errorMessage = "The method error message";
The global handler would display an error message this way:
catch : function(call){
doSomething(call.errorMessage);
}
The template should look like this: