更新框架
This commit is contained in:
1 parent
ef50fa0620
commit
84b28f9672
72 files changed
+2222
-282
No files matched your search
@@ -0,0 +1,18 @@
|
||||
using System.Net;
|
||||
|
||||
namespace Store.Management.Api.Transport;
|
||||
|
||||
public enum ApiErrorKind { Network, Timeout, Http, Business, InvalidResponse, Unauthorized }
|
||||
|
||||
public sealed class ApiException : Exception
|
||||
{
|
||||
public ApiErrorKind Kind { get; }
|
||||
public HttpStatusCode? StatusCode { get; }
|
||||
public int? Code { get; }
|
||||
public string? TraceId { get; }
|
||||
|
||||
public ApiException(ApiErrorKind kind, string message, HttpStatusCode? statusCode = null,
|
||||
int? code = null, string? traceId = null, Exception? innerException = null)
|
||||
: base(message, innerException)
|
||||
=> (Kind, StatusCode, Code, TraceId) = (kind, statusCode, code, traceId);
|
||||
}
|
||||
Reference in new issue
Block a user