From ec7c31ff7602e7a93ceb315e8f8590bf06414bf0 Mon Sep 17 00:00:00 2001 From: Matthew Sevey Date: Fri, 15 Apr 2022 14:43:39 -0400 Subject: [PATCH] Add some comments --- packages/health-check/src/checks/critical.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/health-check/src/checks/critical.js b/packages/health-check/src/checks/critical.js index 17fc24a4..689196b4 100644 --- a/packages/health-check/src/checks/critical.js +++ b/packages/health-check/src/checks/critical.js @@ -61,8 +61,12 @@ async function uploadCheck(done) { try { await skylinkHealthCheck(skylink, 30, authCookie); } catch (error) { + // Reset the up status as the previous successful file upload would have + // set this to true. data.up = false; data.statusCode = error.response?.statusCode || error.statusCode || error.status; + // Default to the error itself if the message or response are null since + // the error can be a simple error string. data.errorMessage = error.message || error; data.errorResponseContent = getResponseContent(error.response) || error; }