From 95b8a0bbfd8a01d3ca72b4239fce63d040f30eb5 Mon Sep 17 00:00:00 2001 From: Aleksander Heintz Date: Thu, 19 Dec 2024 15:46:03 +0100 Subject: [PATCH] fix: add ProblemInstanceException constructor overloads (#175) --- .../ProblemInstanceException.cs | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/Altinn.Authorization.ProblemDetails/src/ProblemDetails.Abstractions/ProblemInstanceException.cs b/src/Altinn.Authorization.ProblemDetails/src/ProblemDetails.Abstractions/ProblemInstanceException.cs index d5a914e..8602b74 100644 --- a/src/Altinn.Authorization.ProblemDetails/src/ProblemDetails.Abstractions/ProblemInstanceException.cs +++ b/src/Altinn.Authorization.ProblemDetails/src/ProblemDetails.Abstractions/ProblemInstanceException.cs @@ -11,7 +11,28 @@ public class ProblemInstanceException /// /// The . public ProblemInstanceException(ProblemInstance problemInstance) - : base(problemInstance.Detail) + : this(null, problemInstance) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The message. + /// The . + public ProblemInstanceException(string? message, ProblemInstance problemInstance) + : this(message, null, problemInstance) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The message. + /// The inner exception. + /// The . + public ProblemInstanceException(string? message, Exception? innerException, ProblemInstance problemInstance) + : base(message ?? problemInstance.Detail, innerException) { Problem = problemInstance; }