Skip to content

Commit

Permalink
fix: changing logs to SonarCloud is happy
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTyrrellNHS committed Nov 15, 2024
1 parent 334b651 commit 523c0fe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymou
}
catch (Exception ex)
{
_logger.LogError(ex, "GetParticipantScreeningProfileData: Failed to get participant profiles from the database.\nException: " + ex.Message);
_logger.LogError(ex, "GetParticipantScreeningProfileData: Failed to get participant profiles from the database.\nException: {Message}", ex.Message);
return req.CreateResponse(HttpStatusCode.InternalServerError);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymou

if (!response.IsSuccessStatusCode)
{
_logger.LogError($"Failed to retrieve profiles. Status Code: {response.StatusCode}");
_logger.LogError("Failed to retrieve profiles. Status Code: {StatusCode}", response.StatusCode);
var errorResponse = req.CreateResponse(response.StatusCode);
return errorResponse;
}
Expand All @@ -78,7 +78,7 @@ public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymou
}
catch (Exception ex)
{
_logger.LogError(ex, "Exception when calling the GetParticipantScreeningProfileData function. \nUrl:{url}\nException: " + ex.Message, url);
_logger.LogError(ex, "Exception when calling the GetParticipantScreeningProfileData function. \nUrl:{url}\nException: {Message}", url, ex.Message);
return req.CreateResponse(HttpStatusCode.InternalServerError);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymou

if (participant == null)
{
_logger.LogError($"Participant with NHS Number {nhsNumber} not found.");
_logger.LogError("Participant with NHS Number {nhsNumber} not found.", nhsNumber);
return req.CreateResponse(HttpStatusCode.NotFound);
}

Expand Down

0 comments on commit 523c0fe

Please sign in to comment.