BililiveRecorder/BililiveRecorder.Core/Api/BilibiliApiResponseCodeNotZeroException.cs

23 lines
797 B
C#
Raw Normal View History

2021-02-23 18:03:37 +08:00
using System;
using System.Runtime.Serialization;
namespace BililiveRecorder.Core.Api
2021-02-23 18:03:37 +08:00
{
internal class BilibiliApiResponseCodeNotZeroException : Exception
2021-02-23 18:03:37 +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() { }
[Obsolete]
2021-02-23 18:03:37 +08:00
public BilibiliApiResponseCodeNotZeroException(string message) : base(message) { }
public BilibiliApiResponseCodeNotZeroException(string message, Exception innerException) : base(message, innerException) { }
}
}