From 06c470bb7111ae30f390f7a96bf6f095debc1a25 Mon Sep 17 00:00:00 2001 From: iatsuta <98311820+iatsuta@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:50:56 +0100 Subject: [PATCH] add-inner-exception-to-InternalServerException (#528) --- .../InternalServerException.cs | 12 +----------- .../WebApiExceptionExpander.cs | 4 ++-- src/__SolutionItems/CommonAssemblyInfo.cs | 6 +++--- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/_DomainDriven/Framework.DomainDriven.WebApiNetCore/WebApiExceptionExpander/InternalServerException.cs b/src/_DomainDriven/Framework.DomainDriven.WebApiNetCore/WebApiExceptionExpander/InternalServerException.cs index b9b83b6b4..b310ef01b 100644 --- a/src/_DomainDriven/Framework.DomainDriven.WebApiNetCore/WebApiExceptionExpander/InternalServerException.cs +++ b/src/_DomainDriven/Framework.DomainDriven.WebApiNetCore/WebApiExceptionExpander/InternalServerException.cs @@ -4,20 +4,10 @@ /// IAD Framework Internal Server Exception /// /// -public class InternalServerException : Exception +public class InternalServerException(string message, Exception innerException) : Exception(message, innerException) { /// /// Default exception message /// public const string DefaultMessage = "Server has encountered system error. Message was sent to the support group"; - - public InternalServerException(string message) - : base(message) - { - } - - public InternalServerException() - : this(DefaultMessage) - { - } } diff --git a/src/_DomainDriven/Framework.DomainDriven.WebApiNetCore/WebApiExceptionExpander/WebApiExceptionExpander.cs b/src/_DomainDriven/Framework.DomainDriven.WebApiNetCore/WebApiExceptionExpander/WebApiExceptionExpander.cs index 3714ff797..0582a46c5 100644 --- a/src/_DomainDriven/Framework.DomainDriven.WebApiNetCore/WebApiExceptionExpander/WebApiExceptionExpander.cs +++ b/src/_DomainDriven/Framework.DomainDriven.WebApiNetCore/WebApiExceptionExpander/WebApiExceptionExpander.cs @@ -14,13 +14,13 @@ public Exception Process(Exception baseException) return this.IsHandledException(exception) ? exception - : this.GetInternalServerException(); + : this.GetInternalServerException(exception); } /// /// Get Internal Server Exception /// - protected virtual Exception GetInternalServerException() => new(InternalServerException.DefaultMessage); + protected virtual Exception GetInternalServerException(Exception exception) => new InternalServerException(InternalServerException.DefaultMessage, exception); /// /// Is Handled Exception diff --git a/src/__SolutionItems/CommonAssemblyInfo.cs b/src/__SolutionItems/CommonAssemblyInfo.cs index d559c29ae..86cf4ebea 100644 --- a/src/__SolutionItems/CommonAssemblyInfo.cs +++ b/src/__SolutionItems/CommonAssemblyInfo.cs @@ -4,9 +4,9 @@ [assembly: AssemblyCompany("Luxoft")] [assembly: AssemblyCopyright("Copyright © Luxoft 2009-2024")] -[assembly: AssemblyVersion("22.5.9.0")] -[assembly: AssemblyFileVersion("22.5.9.0")] -[assembly: AssemblyInformationalVersion("22.5.9.0")] +[assembly: AssemblyVersion("22.5.10.0")] +[assembly: AssemblyFileVersion("22.5.10.0")] +[assembly: AssemblyInformationalVersion("22.5.10.0")] #if DEBUG [assembly: AssemblyConfiguration("Debug")]