Skip to content

Commit ed01630

Browse files
committed
Fix response error handle
1 parent 1b933fa commit ed01630

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Afip.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,10 @@ Afip.prototype.TrackUsage = async function(web_service, operation, params = {})
320320
}
321321
});
322322
} catch (error) {
323-
if (error.response.data && error.response.data.message) {
323+
if (!error.response) {
324+
throw error;
325+
}
326+
else if (error.response.data && error.response.data.message) {
324327
throw Object.assign(new Error(error.response.data.message), error.response.data);
325328
}
326329
else {

0 commit comments

Comments
 (0)