diff --git a/src/git/Github.ts b/src/git/Github.ts index 157cebc2..79b9871d 100644 --- a/src/git/Github.ts +++ b/src/git/Github.ts @@ -6,7 +6,6 @@ import { compose, concat as rConcat, filter, - has, head, join, map, @@ -247,7 +246,10 @@ export class Github implements Remote { map( (user) => user as Reviewer, ), - filter(has('login')), + filter( + (data: RestEndpointMethodTypes['users']['getByUsername']['response']['data']) => + data !== undefined && 'login' in data, + ), ), ); } @@ -300,9 +302,18 @@ export class Github implements Remote { }) private getUserInfo( username: string, - ): Promise { + ): Promise { return this.queueCall( - () => this.api.users.getByUsername({ username }).then(prop('data')), + () => + this.api.users + .getByUsername({ username }) + .then(prop('data')) + .catch((error) => { + if (error.status !== 404) { + throw error; + } + return undefined; + }), `Getting user info for %s`, username, );