2021-02-23 18:03:37 +08:00
|
|
|
using System;
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
2021-03-01 21:38:13 +08:00
|
|
|
namespace BililiveRecorder.Core.Api
|
2021-02-23 18:03:37 +08:00
|
|
|
{
|
2022-05-16 23:28:31 +08:00
|
|
|
internal class BilibiliApiResponseCodeNotZeroException : Exception
|
2021-02-23 18:03:37 +08:00
|
|
|
{
|
2022-12-10 07:59:54 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2021-02-23 18:03:37 +08:00
|
|
|
public BilibiliApiResponseCodeNotZeroException() { }
|
2022-12-10 07:59:54 +08:00
|
|
|
[Obsolete]
|
2021-02-23 18:03:37 +08:00
|
|
|
public BilibiliApiResponseCodeNotZeroException(string message) : base(message) { }
|
|
|
|
public BilibiliApiResponseCodeNotZeroException(string message, Exception innerException) : base(message, innerException) { }
|
|
|
|
protected BilibiliApiResponseCodeNotZeroException(SerializationInfo info, StreamingContext context) : base(info, context) { }
|
|
|
|
}
|
|
|
|
}
|