fix error message in liboidcagent
@@ -14,6 +14,8 @@ struct agent_response parseForAgentResponse(char* response) {
res.type = AGENT_RESPONSE_TYPE_ERROR;
res.error_response = (struct agent_error_response){
oidc_strcopy("did not receive any response"), NULL};
+ oidc_errno = OIDC_EERROR;
+ oidc_seterror(res.error_response.error);
return res;
}
INIT_KEY_VALUE(IPC_KEY_STATUS, OIDC_KEY_ERROR, IPC_KEY_INFO,
@@ -26,16 +28,18 @@ struct agent_response parseForAgentResponse(char* response) {
oidc_strcopy("read malformed data"),
oidc_strcopy("Please hand in a bug report: "
"https://github.com/indigo-dc/oidc-agent")};
+ oidc_errno = OIDC_EERROR;
+ oidc_seterror(res.error_response.error);
return res;
}
secFree(response);
KEY_VALUE_VARS(status, error, info, access_token, issuer, expires_at);
if (_error) { // error
- oidc_errno = OIDC_EERROR;
- oidc_seterror(_error);
res.type = AGENT_RESPONSE_TYPE_ERROR;
res.error_response = (struct agent_error_response){oidc_strcopy(_error),
oidc_strcopy(_info)};
+ oidc_errno = OIDC_EERROR;
+ oidc_seterror(res.error_response.error);
SEC_FREE_KEY_VALUES();
return res;
} else {
