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

Commit a2859d1

Browse files
author
Andreia Gaita
committed
Merge master into fixes/api-failure-switch-auth-view
2 parents 97273c4 + c14fb8d commit a2859d1

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ 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";
25+
private const string PublishToGithubLabel = "Publish to GitHub";
2526
private const string AuthenticationChangedMessageFormat = "You were authenticated as \"{0}\", but you are now authenticated as \"{1}\". Would you like to proceed or logout?";
2627
private const string AuthenticationChangedTitle = "Authentication Changed";
2728
private const string AuthenticationChangedProceed = "Proceed";
@@ -159,7 +160,7 @@ public override void OnGUI()
159160
{
160161
GUILayout.BeginHorizontal(Styles.AuthHeaderBoxStyle);
161162
{
162-
GUILayout.Label("Publish to GitHub", EditorStyles.boldLabel);
163+
GUILayout.Label(PublishToGithubLabel, EditorStyles.boldLabel);
163164
}
164165
GUILayout.EndHorizontal();
165166

@@ -198,7 +199,7 @@ public override void OnGUI()
198199
{
199200
Logger.Error(ex, "Repository Create Error Type:{0}", ex.GetType().ToString());
200201

201-
error = ex.Message;
202+
error = GetPublishErrorMessage(ex);
202203
isBusy = false;
203204
return;
204205
}
@@ -231,6 +232,16 @@ public override void OnGUI()
231232
EditorGUI.EndDisabledGroup();
232233
}
233234

235+
private string GetPublishErrorMessage(Exception ex)
236+
{
237+
if (ex.Message.StartsWith(PublishLimitPrivateRepositoriesError))
238+
{
239+
return PublishLimitPrivateRepositoriesError;
240+
}
241+
242+
return ex.Message;
243+
}
244+
234245
public override bool IsBusy
235246
{
236247
get { return isBusy; }

0 commit comments

Comments
 (0)