From 1e9904ff1003193364d3e2f55a109f0b7fd9808c Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Sun, 31 Jan 2021 23:02:33 +0800 Subject: [PATCH] fix: log error when cannot resolve --- server/api/github.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/api/github.ts b/server/api/github.ts index 559eebf..764cc9b 100644 --- a/server/api/github.ts +++ b/server/api/github.ts @@ -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 }