Implement RepositoryExistsException

This exception is thrown when we try to create a repository but it
already exists on the server.
This commit is contained in:
Haacked
2014-02-18 16:51:59 -08:00
parent 4da4c39d2b
commit dae6cb2ca6
13 changed files with 304 additions and 4 deletions
+16
View File
@@ -0,0 +1,16 @@
using System.Linq;
namespace Octokit
{
internal static class ApiErrorExtensions
{
public static string FirstErrorMessageSafe(this ApiError apiError)
{
if (apiError == null) return null;
if (apiError.Errors == null) return null;
var firstError = apiError.Errors.FirstOrDefault();
if (firstError == null) return null;
return firstError.Message;
}
}
}