Skip to content

Commit

Permalink
Fix codesmell
Browse files Browse the repository at this point in the history
  • Loading branch information
tjololo committed Aug 30, 2023
1 parent d12702d commit ada9e24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Altinn.App.Api/Controllers/DataController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,14 @@ public async Task<ActionResult> Create(
await streamContent.CopyToAsync(fileStream);
if (fileStream.Length == 0)
{
const string errorMessage = "Invalid data provided. Error: The file is zero bytes.";
var error = new ValidationIssue
{
Code = ValidationIssueCodes.DataElementCodes.ContentTypeNotAllowed,
Severity = ValidationIssueSeverity.Error,
Description = $"Invalid data provided. Error: The file is zero bytes."
Description = errorMessage
};
_logger.LogError(error.Description);
_logger.LogError(errorMessage);
return new BadRequestObjectResult(await GetErrorDetails(new List<ValidationIssue> { error }));
}

Expand Down

0 comments on commit ada9e24

Please sign in to comment.