Files
29WxOrder/OrderSupportTicket/Services/TicketApiException.cs
T
2026-10-20 17:03:23 +08:00

40 lines
980 B
C#

using System;
namespace OrderSupportTicket.Services;
/// <summary>
/// 工单接口调用失败时返回的异常。
/// </summary>
public sealed class TicketApiException : Exception
{
/// <summary>
/// 创建工单接口异常。
/// </summary>
public TicketApiException(
int statusCode,
string message,
string responseBody = null,
string errorCode = null)
: base(message)
{
StatusCode = statusCode;
ResponseBody = responseBody;
ErrorCode = errorCode;
}
/// <summary>
/// 服务端返回的状态码;无法从 GetHtml 响应中识别时为 0。
/// </summary>
public int StatusCode { get; }
/// <summary>
/// 服务端返回的原始响应正文。
/// </summary>
public string ResponseBody { get; }
/// <summary>
/// 服务端返回的错误码,例如 client_api_image_expired。
/// </summary>
public string ErrorCode { get; }
}