Skip to content

Commit

Permalink
Merge pull request #183 from chu11/redfishpower_error_messages
Browse files Browse the repository at this point in the history
redfishpower: output more detailed error messages
  • Loading branch information
mergify[bot] committed Apr 27, 2024
2 parents 2d601c1 + 2946b1e commit 1990992
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/redfishpower/redfishpower.c
Original file line number Diff line number Diff line change
Expand Up @@ -1589,10 +1589,7 @@ static void shell(CURLM *mh)
err_exit(false, "private data not set in easy handle");

if (cmsg->data.result != 0) {
if (cmsg->data.result == CURLE_COULDNT_CONNECT
|| cmsg->data.result == CURLE_OPERATION_TIMEDOUT)
printf("%s: %s\n", pm->plugname, "network error");
else if (cmsg->data.result == CURLE_HTTP_RETURNED_ERROR) {
if (cmsg->data.result == CURLE_HTTP_RETURNED_ERROR) {
/* N.B. curl returns this error code for all response
* codes >= 400. So gotta dig in more.
*/
Expand All @@ -1615,7 +1612,9 @@ static void shell(CURLM *mh)
code);
}
else
printf("%s: %s\n", pm->plugname, "error");
printf("%s: %s\n",
pm->plugname,
curl_easy_strerror(cmsg->data.result));
if (verbose)
printf("%s: %s\n", pm->plugname,
curl_easy_strerror(cmsg->data.result));
Expand Down

0 comments on commit 1990992

Please sign in to comment.