Add default messages for custom exceptions

Right now, our exception messages come from the API response in most
cases. But if for any reason there isn't one, we supply a default. I
realized these messages might make it to people's logs so it might be
nice to spend time later making them even more useful.
This commit is contained in:
Haacked
2013-10-18 11:08:56 -07:00
parent a1887837be
commit c87944c884
15 changed files with 137 additions and 1 deletions
@@ -31,6 +31,11 @@ namespace Octokit
TwoFactorType = twoFactorType;
}
public override string Message
{
get { return ApiErrorMessageSafe ?? "Two-factor authentication code is required"; }
}
#if !NETFX_CORE
protected TwoFactorRequiredException(SerializationInfo info, StreamingContext context)
: base(info, context)