Skip to content

Commit

Permalink
DisallowNull
Browse files Browse the repository at this point in the history
  • Loading branch information
xljiulang committed Jun 6, 2020
1 parent 773f431 commit f9cdcc5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions WebApiClientCore/ApiResponseContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;

namespace WebApiClientCore
Expand All @@ -21,8 +22,8 @@ public object? Result
set
{
this.result = value;
this.exception = null;
this.ResultStatus = ResultStatus.HasResult;
this.exception = null;
}
}

Expand All @@ -31,14 +32,15 @@ public object? Result
/// 在IApiReturnAttribute设置该值之后会中断下一个IApiReturnAttribute的执行
/// </summary>
/// <exception cref="ArgumentNullException"></exception>
[DisallowNull]
public Exception? Exception
{
get => this.exception;
set
{
this.result = null;
this.exception = value ?? throw new ArgumentNullException(nameof(Exception));
this.ResultStatus = ResultStatus.HasException;
this.result = null;
}
}

Expand Down

0 comments on commit f9cdcc5

Please sign in to comment.