Skip to content

Commit

Permalink
Fixes in the enrollment process (#69)
Browse files Browse the repository at this point in the history
* enhance logs when token expired

* condence log message for token expiration error

* send core error message
  • Loading branch information
cpprian authored Aug 4, 2024
1 parent a07b0e4 commit fb5241d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async fn get_core_response(rx: Receiver<Payload>) -> Result<Payload, ApiError> {
if let Ok(core_response) = timeout(Duration::from_secs(CORE_RESPONSE_TIMEOUT), rx).await {
debug!("Got gRPC response from Defguard core: {core_response:?}");
if let Ok(Payload::CoreError(core_error)) = core_response {
return Err(core_error.into());
return Err(ApiError::BadRequest(format!("{}", core_error.message)));
};
core_response
.map_err(|err| ApiError::Unexpected(format!("Failed to receive core response: {err}")))
Expand Down

0 comments on commit fb5241d

Please sign in to comment.