using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
namespace Octokit
{
///
/// Exception thrown when creating a private repository, but the user's private quota is or would be exceeded
/// by creating it.
///
#if !NETFX_CORE
[Serializable]
#endif
[SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors",
Justification = "These exceptions are specific to the GitHub API and not general purpose exceptions")]
public class PrivateRepositoryQuotaExceededException : ApiValidationException
{
///
/// Constructs an instance of PrivateRepositoryQuotaExceededException.
///
/// The inner validation exception.
public PrivateRepositoryQuotaExceededException(ApiValidationException innerException)
: base(innerException)
{
}
public override string Message
{
get
{
// TODO: Would be nice to show the actual numbers, but that requires another request.
return "You are currently at your limit of private repositories. Either delete a private repository you no "
+ "longer use (https://help.github.com/articles/deleting-a-repository/) or upgrade your account to a plan "
+ "that allows for more private repositories (https://help.github.com/articles/what-plan-should-i-choose/).";
}
}
#if !NETFX_CORE
///
/// Constructs an instance of PrivateRepositoryQuotaExceededException
///
///
/// The that holds the
/// serialized object data about the exception being thrown.
///
///
/// The that contains
/// contextual information about the source or destination.
///
protected PrivateRepositoryQuotaExceededException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
#endif
}
}