mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-05 23:06:10 +00:00
52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Globalization;
|
|
|
|
namespace Octokit
|
|
{
|
|
/// <summary>
|
|
/// Error payload from the API response
|
|
/// </summary>
|
|
[Serializable]
|
|
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
|
public class ApiError
|
|
{
|
|
public ApiError() { }
|
|
|
|
public ApiError(string message)
|
|
{
|
|
Message = message;
|
|
}
|
|
|
|
public ApiError(string message, string documentationUrl, IReadOnlyList<ApiErrorDetail> errors)
|
|
{
|
|
Message = message;
|
|
DocumentationUrl = documentationUrl;
|
|
Errors = errors;
|
|
}
|
|
|
|
/// <summary>
|
|
/// The error message
|
|
/// </summary>
|
|
public string Message { get; protected set; }
|
|
|
|
/// <summary>
|
|
/// URL to the documentation for this error.
|
|
/// </summary>
|
|
public string DocumentationUrl { get; protected set; }
|
|
|
|
/// <summary>
|
|
/// Additional details about the error
|
|
/// </summary>
|
|
public IReadOnlyList<ApiErrorDetail> Errors { get; protected set; }
|
|
|
|
internal string DebuggerDisplay
|
|
{
|
|
get
|
|
{
|
|
return string.Format(CultureInfo.InvariantCulture, "Message: {0}", Message);
|
|
}
|
|
}
|
|
}
|
|
} |