-
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.
Merge pull request #2 from deveel/support-1
Support Package 1
- Loading branch information
Showing
7 changed files
with
371 additions
and
55 deletions.
There are no files selected for viewing
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,28 @@ | ||
namespace Deveel | ||
{ | ||
/// <summary> | ||
/// Extends the <see cref="IOperationError"/> contract to provide | ||
/// additional functionality. | ||
/// </summary> | ||
public static class OperationErrorExtensions | ||
{ | ||
/// <summary> | ||
/// Converts the error to an operation exception. | ||
/// </summary> | ||
/// <param name="error"> | ||
/// The error to convert to an exception. | ||
/// </param> | ||
/// <returns> | ||
/// Returns an instance of <see cref="OperationException"/> that | ||
/// represents the error. | ||
/// </returns> | ||
/// <exception cref="ArgumentNullException"> | ||
/// Thrown when the <paramref name="error"/> is <see langword="null"/>. | ||
/// </exception> | ||
public static OperationException AsException(this IOperationError error) | ||
{ | ||
ArgumentNullException.ThrowIfNull(error, nameof(error)); | ||
return new OperationException(error.Code, error.Domain, error.Message, error.InnerError?.AsException()); | ||
} | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.