fix: 🐛 Fix errors not getting propagated up from client daemon (#2099)

This commit is contained in:
Zhihe Li authored and GitHub committed 2024-01-19 18:13:33 -05:00
1 parent 5a74220f38
commit f71fc3a0a4
1 file changed
+9
@@ -54,6 +54,15 @@ const unixSocketRequest = (options, reqBody) =>
parsedResponse = JSON.parse(response);
}
// Reject the response if the status code is not in the 2xx range.
const { statusCode } = res;
if (statusCode < 200 || statusCode >= 400) {
reject({
statusCode,
...parsedResponse,
});
}
resolve(parsedResponse);
} catch (e) {
reject(e);