refactor: log res if github initRepo fails (#998)

pull/999/head v9.90.3
Rhys Arkins 2017-10-19 20:45:25 +02:00 committed by GitHub
parent 48f2b5a2e1
commit 709a8c20ba
1 changed files with 3 additions and 2 deletions

View File

@ -156,8 +156,9 @@ async function initRepo(repoName, token, endpoint, repoLogger) {
config.fileList = null;
config.prList = null;
const platformConfig = {};
let res;
try {
const res = await get(`repos/${repoName}`, {
res = await get(`repos/${repoName}`, {
headers: {
accept: 'application/vnd.github.loki-preview+json',
},
@ -206,7 +207,7 @@ async function initRepo(repoName, token, endpoint, repoLogger) {
logger.debug('Repository is not initiated');
throw new Error('uninitiated');
}
logger.error({ err }, 'Unknown GitHub initRepo error');
logger.info({ err, res }, 'Unknown GitHub initRepo error');
throw err;
}
return platformConfig;