Skip to content

Commit

Permalink
Add additional constructor for Error type
Browse files Browse the repository at this point in the history
  • Loading branch information
matsakiv committed Aug 29, 2024
1 parent 0fa4437 commit bdc3dda
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Incendium.Result/Error.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ public Error(int code, string message)
{
}

/// <summary>
/// Initialize a new instance of the error with a specified error code, message and exception
/// </summary>
/// <param name="code">Error code</param>
/// <param name="message">Error message</param>
/// <param name="exception">Inner exception</param>
public Error(int code, string message, Exception? exception)
: this(code, message, exception, innerError: null)
{
}

/// <summary>
/// Initialize a new instance of the error with a specified error message and inner exception
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Incendium.Result/Incendium.Result.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<Title>Incendium.Result</Title>
<Authors>mativ</Authors>
<Description>Provides a Result&lt;T&gt; type that allows a method to return both a value and an error in Rust style without exceptions</Description>
<Version>1.0.3</Version>
<Version>1.0.4</Version>
<Copyright>Copyright © Igor Matsak</Copyright>
</PropertyGroup>

Expand Down

0 comments on commit bdc3dda

Please sign in to comment.