Skip to content

Commit 00ec3a1

Browse files
authored
Handle curl exception scenario
The `execCurl` function has the potential to return null which was not properly being handled downstream.
1 parent bd67961 commit 00ec3a1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmds/curlx.js

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ const { execCurl } = require('../utils/execute-curl.js');
55

66
module.exports = async (args, exec_str, db) => {
77
let cx_response = await execCurl(exec_str);
8+
if (!cx_response) {
9+
outputResponse(`Error while executing ${exec_str}`);
10+
return;
11+
}
812
outputResponseHeaders(cx_response.responseHeaders);
913
outputResponse(cx_response.responseBody);
1014
if (cx_response.logData) {

0 commit comments

Comments
 (0)