Skip to content

Commit

Permalink
Increase logging of errors
Browse files Browse the repository at this point in the history
commit 6113eac started using MQTT_RC_*
enums as a handle__publish return value, which typically were MOSQ_ERR_*
values.

Signed-off-by: Flávio Tapajós <[email protected]>
  • Loading branch information
ftapajos authored and ralight committed Sep 6, 2024
1 parent 39eac98 commit a87b5ff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/strings_mosq.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ const char *mosquitto_strerror(int mosq_errno)
case MOSQ_ERR_OCSP:
return "OCSP error.";
default:
return "Unknown error.";
if(mosq_errno >= 128) {
// If mosq_errno is greater than 127,
// a mqtt5_return_code error was used
return mosquitto_reason_string(mosq_errno);
} else {
return "Unknown error.";
}
}
}

Expand Down

0 comments on commit a87b5ff

Please sign in to comment.