diff --git a/backend/api-renamed/status/pat-info.js b/backend/api-renamed/status/pat-info.js index 8b15d76b..43c6fc39 100644 --- a/backend/api-renamed/status/pat-info.js +++ b/backend/api-renamed/status/pat-info.js @@ -141,14 +141,19 @@ export default async (_, res) => { res.setHeader("Content-Type", "application/json"); try { // Add header to prevent abuse. - const PATsInfo = await getPATInfo(uptimeFetcher, {}); - if (PATsInfo) { - res.setHeader( - "Cache-Control", - `max-age=0, s-maxage=${RATE_LIMIT_SECONDS}`, - ); + try { + const PATsInfo = await getPATInfo(uptimeFetcher, {}); + if (PATsInfo) { + res.setHeader( + "Cache-Control", + `max-age=0, s-maxage=${RATE_LIMIT_SECONDS}`, + ); + } + res.send(JSON.stringify(PATsInfo, null, 2)); + console.log("pat-info done"); + } catch (e) { + console.log("pat-info exception:", e); } - res.send(JSON.stringify(PATsInfo, null, 2)); } catch (err) { // Throw error if something went wrong. logger.error(err); diff --git a/backend/src/common/utils.js b/backend/src/common/utils.js index 0ddd9b9b..10b171f0 100644 --- a/backend/src/common/utils.js +++ b/backend/src/common/utils.js @@ -248,7 +248,7 @@ const buildSearchFilter = (repos = [], owners = []) => { * @returns {Promise} Request response. */ const request = (data, headers) => { - console.log("making request with: " + headers + " | " + data); + console.log("making request with: " + JSON.stringify(headers) + " | " + JSON.stringify(data)); try { let response = axios({ url: "https://api.github.com/graphql",