fix: log error when cannot resolve

This commit is contained in:
EnixCoda 2021-01-31 23:02:33 +08:00
parent 95a258a9b9
commit 1e9904ff10
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD

View file

@ -23,7 +23,8 @@ async function oauth(code: string) {
if (errorDescription) {
throw new Error(errorDescription)
} else if (scope !== 'repo' || !accessToken || !(typeof accessToken === 'string')) {
throw new Error(`Cannot resolve response: '${JSON.stringify(res)}'`)
console.log(JSON.stringify(body))
throw new Error(`Cannot resolve response from GitHub`)
}
return accessToken
}