Skip to content

Commit

Permalink
log errors like network in api calling
Browse files Browse the repository at this point in the history
Eliminated JSON.stringify method for managing response that are not Json
  • Loading branch information
hosseinRezaei188 authored Mar 5, 2022
1 parent a4e01e8 commit 8bdd08b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kavenegar.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ KavenegarApi.prototype.request = function(action, method, params, callback) {
} catch (e){
console.log('Exception!',e);
if(callback){
callback([],500,e.message)
callback(e.message,500)
}
}
})
Expand Down Expand Up @@ -104,4 +104,4 @@ KavenegarApi.prototype.CallMakeTTS = function(data, callback) {
module.exports.KavenegarApi = function (options) {
var obj = new KavenegarApi(options);
return obj;
}
}

0 comments on commit 8bdd08b

Please sign in to comment.