Skip to content

Commit

Permalink
Use proper indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ea-mtenhoor committed Dec 5, 2024
1 parent e7daaf3 commit 74a5ecf
Showing 1 changed file with 29 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,43 +185,42 @@ private async Task<IEnumerable<ErrorItemMessage>> HandlePostItemMessage(
}
else
{
if (javaScriptModuleFactory != null)
{
var remediationResult = await TryRemediateFailureAsync(
javaScriptModuleFactory,
retryAttempt,
targetEdFiApiClient,
_sourceConnectionDetails.Name,
postItemMessage.ResourceUrl,
id,
result.Result,
postItemMessage.Item.ToString());

if (!remediationResult.FoundRemediation)
if (javaScriptModuleFactory != null)
{
knownUnremediatedRequests.Add((postItemMessage.ResourceUrl, result.Result.StatusCode));
var remediationResult = await TryRemediateFailureAsync(
javaScriptModuleFactory,
retryAttempt,
targetEdFiApiClient,
_sourceConnectionDetails.Name,
postItemMessage.ResourceUrl,
id,
result.Result,
postItemMessage.Item.ToString());

if (!remediationResult.FoundRemediation)
{
knownUnremediatedRequests.Add((postItemMessage.ResourceUrl, result.Result.StatusCode));

return;
}
return;
}

// Check for a modified request body, and save it to the context
if (remediationResult.ModifiedRequestBody is JsonElement modifiedRequestBody
&& modifiedRequestBody.ValueKind != JsonValueKind.Null)
{
if (_logger.IsEnabled(LogEventLevel.Debug))
// Check for a modified request body, and save it to the context
if (remediationResult.ModifiedRequestBody is JsonElement modifiedRequestBody
&& modifiedRequestBody.ValueKind != JsonValueKind.Null)
{
string modifiedRequestBodyJson = JsonSerializer.Serialize(
remediationResult.ModifiedRequestBody,
new JsonSerializerOptions { WriteIndented = true });
if (_logger.IsEnabled(LogEventLevel.Debug))
{
string modifiedRequestBodyJson = JsonSerializer.Serialize(
remediationResult.ModifiedRequestBody,
new JsonSerializerOptions { WriteIndented = true });

var message = $"{postItemMessage.ResourceUrl} (source id: {id}): Remediation plan provided a modified request body: {modifiedRequestBodyJson}";
_logger.Debug(message);
}
var message = $"{postItemMessage.ResourceUrl} (source id: {id}): Remediation plan provided a modified request body: {modifiedRequestBodyJson}";
_logger.Debug(message);
}

ctx["ModifiedRequestBody"] = remediationResult.ModifiedRequestBody;
ctx["ModifiedRequestBody"] = remediationResult.ModifiedRequestBody;
}
}
}


string responseContent = await result.Result.Content.ReadAsStringAsync().ConfigureAwait(false);

Expand Down

0 comments on commit 74a5ecf

Please sign in to comment.