BililiveRecorder/BililiveRecorder.Core/Api/BilibiliApiResponseCodeNotZeroException.cs
2022-12-10 07:59:54 +08:00

24 lines
931 B
C#

using System;
using System.Runtime.Serialization;
namespace BililiveRecorder.Core.Api
{
internal class BilibiliApiResponseCodeNotZeroException : Exception
{
public int? Code { get; }
public string? Body { get; }
public BilibiliApiResponseCodeNotZeroException(int? code, string? body) : base(message: "BiliBili API Code: " + (code?.ToString() ?? "(null)") + "\n" + body)
{
this.Code = code;
this.Body = body;
}
public BilibiliApiResponseCodeNotZeroException() { }
[Obsolete]
public BilibiliApiResponseCodeNotZeroException(string message) : base(message) { }
public BilibiliApiResponseCodeNotZeroException(string message, Exception innerException) : base(message, innerException) { }
protected BilibiliApiResponseCodeNotZeroException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}