From 62215b282478417c8c364cfb942cde6231f855ea Mon Sep 17 00:00:00 2001 From: Gleb Khmyznikov Date: Tue, 7 Nov 2023 15:04:40 +0100 Subject: [PATCH] Bump Libs version --- AppImageGenerator.csproj | 14 +++++++------- Controllers/ImageController.cs | 12 ++++++++++-- Models/ImageGenerationModel.cs | 2 -- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/AppImageGenerator.csproj b/AppImageGenerator.csproj index bcde42a..b6e3772 100644 --- a/AppImageGenerator.csproj +++ b/AppImageGenerator.csproj @@ -10,15 +10,15 @@ - - - - + + + + - + - - + + diff --git a/Controllers/ImageController.cs b/Controllers/ImageController.cs index fd66fc0..f935bda 100644 --- a/Controllers/ImageController.cs +++ b/Controllers/ImageController.cs @@ -62,8 +62,16 @@ public async Task Get(string id) } catch (Exception ex) { - _logger.LogError(ex, string.Format("{{GetZipById}}: Couldn't get generated zip due to exception", GetZipById)); - return StatusCode((int)HttpStatusCode.InternalServerError, ex.ToString()); + if (ex.Message.StartsWith("Could not find file")) + { + _logger.LogError(ex, string.Format("{{GetZipById}}: Couldn't find file", GetZipById)); + return StatusCode((int)HttpStatusCode.NotFound, ex.ToString()); + } + else { + _logger.LogError(ex, string.Format("{{GetZipById}}: Couldn't get generated zip due to exception", GetZipById)); + return StatusCode((int)HttpStatusCode.InternalServerError, ex.ToString()); + } + } } diff --git a/Models/ImageGenerationModel.cs b/Models/ImageGenerationModel.cs index b15b1dd..4b7f4e8 100644 --- a/Models/ImageGenerationModel.cs +++ b/Models/ImageGenerationModel.cs @@ -1,8 +1,6 @@ using System.Globalization; -using SixLabors.ImageSharp; using SixLabors.ImageSharp.Formats; -using SixLabors.ImageSharp.Processing; using SkiaSharp; using SKSvg = Svg.Skia.SKSvg;