Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 80e392b

Browse files
Restoring code to change the error message
1 parent a873155 commit 80e392b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PublishView.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class PublishView : Subview
2121
private const string RepositoryNameLabel = "Repository Name";
2222
private const string DescriptionLabel = "Description";
2323
private const string CreatePrivateRepositoryLabel = "Make repository private";
24-
private const string PublishLimtPrivateRepositoriesError = "You are currently at your limt of private repositories";
24+
private const string PublishLimitPrivateRepositoriesError = "You are currently at your limit of private repositories";
2525

2626
[SerializeField] private string username;
2727
[SerializeField] private string[] owners = { OwnersDefaultText };
@@ -177,7 +177,7 @@ public override void OnGUI()
177177
{
178178
Logger.Error(ex, "Repository Create Error Type:{0}", ex.GetType().ToString());
179179

180-
error = ex.Message;
180+
error = GetPublishErrorMessage(ex);
181181
isBusy = false;
182182
return;
183183
}
@@ -210,6 +210,16 @@ public override void OnGUI()
210210
EditorGUI.EndDisabledGroup();
211211
}
212212

213+
private string GetPublishErrorMessage(Exception ex)
214+
{
215+
if (ex.Message.StartsWith(PublishLimitPrivateRepositoriesError))
216+
{
217+
return PublishLimitPrivateRepositoriesError;
218+
}
219+
220+
return ex.Message;
221+
}
222+
213223
public override bool IsBusy
214224
{
215225
get { return isBusy; }

0 commit comments

Comments
 (0)