Skip to content

Commit

Permalink
docs: add XML docs for exceptions
Browse files Browse the repository at this point in the history
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
  • Loading branch information
feO2x committed May 9, 2024
1 parent 73be4f7 commit 6fffb3e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/ErrorOr/ErrorOr.ImplicitConverters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public static implicit operator ErrorOr<TValue>(Error error)
/// <summary>
/// Creates an <see cref="ErrorOr{TValue}"/> from a list of errors.
/// </summary>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="errors"/> is null.</exception>
/// <exception cref="InvalidOperationException">Thrown when <paramref name="errors" /> is an empty list.</exception>
public static implicit operator ErrorOr<TValue>(List<Error> errors)
{
if (errors is null)
Expand All @@ -39,6 +41,8 @@ public static implicit operator ErrorOr<TValue>(List<Error> errors)
/// <summary>
/// Creates an <see cref="ErrorOr{TValue}"/> from a list of errors.
/// </summary>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="errors"/> is null.</exception>
/// <exception cref="InvalidOperationException">Thrown when <paramref name="errors" /> is an empty array.</exception>
public static implicit operator ErrorOr<TValue>(Error[] errors)
{
if (errors is null)
Expand Down
8 changes: 5 additions & 3 deletions src/ErrorOr/ErrorOr.ToErrorOrExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ public static ErrorOr<TValue> ToErrorOr<TValue>(this Error error)
}

/// <summary>
/// Creates an <see cref="ErrorOr{TValue}"/> instance with the given <paramref name="error"/>.
/// Creates an <see cref="ErrorOr{TValue}"/> instance with the given <paramref name="errors"/>.
/// </summary>
public static ErrorOr<TValue> ToErrorOr<TValue>(this List<Error> error)
/// <exception cref="ArgumentNullException">Thrown when <paramref name="errors"/> is null.</exception>
/// <exception cref="InvalidOperationException">Thrown when <paramref name="errors" /> is an empty list.</exception>
public static ErrorOr<TValue> ToErrorOr<TValue>(this List<Error> errors)
{
return error;
return errors;
}
}

0 comments on commit 6fffb3e

Please sign in to comment.