-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also add `EnsureSuccess` to `Result<T>`.
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
....Authorization.ProblemDetails/src/ProblemDetails.Abstractions/ProblemInstanceException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace Altinn.Authorization.ProblemDetails; | ||
|
||
/// <summary> | ||
/// An exception that represents a <see cref="ProblemInstance"/>. | ||
/// </summary> | ||
public class ProblemInstanceException | ||
: InvalidOperationException | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ProblemInstanceException"/> class. | ||
/// </summary> | ||
/// <param name="problemInstance">The <see cref="ProblemInstance"/>.</param> | ||
public ProblemInstanceException(ProblemInstance problemInstance) | ||
: base(problemInstance.Detail) | ||
{ | ||
ProblemInstance = problemInstance; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the <see cref="ProblemInstance"/>. | ||
/// </summary> | ||
public ProblemInstance ProblemInstance { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters