mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-23 15:45:28 +00:00
This exception is thrown when we try to create a repository but it already exists on the server.
17 lines
449 B
C#
17 lines
449 B
C#
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;
|
|
}
|
|
}
|
|
}
|