mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-04 03:16:11 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user