Skip to content

Commit b41e0a7

Browse files
author
Leo
authored
Add Support for Throwing Errors
Instead of simply logging it to the console, let the caller handle the error
1 parent 6fc8208 commit b41e0a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ipapi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var _request = function(path, callback, isJson){
3737
});
3838

3939
req.on('error', function(e) {
40-
console.log('Request Error ! ' + e.message);
40+
callback(new Error(e));
4141
});
4242
};
4343

0 commit comments

Comments
 (0)