Permalink
Browse files

Refactor (moip.js) - Add message errors

  • Loading branch information...
1 parent 79dcc8d commit 093ccaab06dc178142e960b30a74540a5803cb73 @stereo-mission stereo-mission committed Feb 5, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 moip.js
View
@@ -194,6 +194,14 @@ function Sender(){
var parser = new xml2js.Parser();
parser.parseString(chunck.toString(), function (err, result) {
+
+ if(err){
+ console.log('[MOIP_MODULE_ERROR]: ',err);
+ console.log('[MOIP_MODULE_RESULT]:',result);
+ options.callback(null);
+ return;
+ }
+
var Resposta = result["ns1:EnviarInstrucaoUnicaResponse"]['Resposta'][0];
if(options.callback){
if(typeof(options.callback) === 'function'){

0 comments on commit 093ccaa

Please sign in to comment.