Skip to content
This repository was archived by the owner on Jan 16, 2020. It is now read-only.

Commit f900e81

Browse files
committed
Gracefully handle remote repos that don't exist.
1 parent 7af64f4 commit f900e81

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/service.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ extend( Repo.prototype, {
6565

6666
function( error, tags ) {
6767
if ( error ) {
68+
if ( /Repository not found/.test( error.message ) ) {
69+
repo.informRepoNotFound();
70+
return fn( null, [] );
71+
}
72+
6873
return fn( error );
6974
}
7075

@@ -186,6 +191,9 @@ extend( Repo.prototype, {
186191
informOtherOwner: function( data ) {
187192
this.inform( this.id + " " + data.tag + " cannot publish " + data.name + " which is owned by " + data.owner );
188193
},
194+
informRepoNotFound: function() {
195+
this.inform( this.id + " repo not found on remote server." );
196+
},
189197
informSuccess: function( data ) {
190198
this.inform( this.id + " SUCCESSFULLY ADDED " + data.name + " v" + data.version + "!" );
191199
}

0 commit comments

Comments
 (0)