@@ -21,6 +21,7 @@ class PublishView : Subview
21
21
private const string RepositoryNameLabel = "Repository Name" ;
22
22
private const string DescriptionLabel = "Description" ;
23
23
private const string CreatePrivateRepositoryLabel = "Create as a private repository" ;
24
+ private const string PublishLimtPrivateRepositoriesError = "You are currently at your limt of private repositories" ;
24
25
25
26
[ SerializeField ] private string username ;
26
27
[ SerializeField ] private string [ ] owners = { OwnersDefaultText } ;
@@ -235,11 +236,11 @@ public override void OnGUI()
235
236
Description = cleanRepoDescription
236
237
} , ( repository , ex ) =>
237
238
{
238
- Logger . Trace ( "Create Repository Callback" ) ;
239
-
240
239
if ( ex != null )
241
240
{
242
- error = ex . Message ;
241
+ Logger . Error ( ex , "Repository Create Error Type:{0}" , ex . GetType ( ) . ToString ( ) ) ;
242
+
243
+ error = GetPublishErrorMessage ( ex ) ;
243
244
isBusy = false ;
244
245
return ;
245
246
}
@@ -251,6 +252,8 @@ public override void OnGUI()
251
252
return ;
252
253
}
253
254
255
+ Logger . Trace ( "Repository Created" ) ;
256
+
254
257
GitClient . RemoteAdd ( "origin" , repository . CloneUrl )
255
258
. Then ( GitClient . Push ( "origin" , Repository . CurrentBranch . Value . Name ) )
256
259
. ThenInUI ( Finish )
@@ -265,6 +268,16 @@ public override void OnGUI()
265
268
EditorGUI . EndDisabledGroup ( ) ;
266
269
}
267
270
271
+ private string GetPublishErrorMessage ( Exception ex )
272
+ {
273
+ if ( ex . Message . StartsWith ( PublishLimtPrivateRepositoriesError ) )
274
+ {
275
+ return PublishLimtPrivateRepositoriesError ;
276
+ }
277
+
278
+ return ex . Message ;
279
+ }
280
+
268
281
public override bool IsBusy
269
282
{
270
283
get { return isBusy ; }
0 commit comments