Skip to content

Commit

Permalink
add-inner-exception-to-InternalServerException (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
iatsuta authored Dec 13, 2024
1 parent 98074ba commit 06c470b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,10 @@
/// IAD Framework Internal Server Exception
/// </summary>
/// <inheritdoc cref="Exception" />
public class InternalServerException : Exception
public class InternalServerException(string message, Exception innerException) : Exception(message, innerException)
{
/// <summary>
/// Default exception message
/// </summary>
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)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ public Exception Process(Exception baseException)

return this.IsHandledException(exception)
? exception
: this.GetInternalServerException();
: this.GetInternalServerException(exception);
}

/// <summary>
/// Get Internal Server Exception
/// </summary>
protected virtual Exception GetInternalServerException() => new(InternalServerException.DefaultMessage);
protected virtual Exception GetInternalServerException(Exception exception) => new InternalServerException(InternalServerException.DefaultMessage, exception);

/// <summary>
/// Is Handled Exception
Expand Down
6 changes: 3 additions & 3 deletions src/__SolutionItems/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit 06c470b

Please sign in to comment.