Add some comments

This commit is contained in:
Matthew Sevey 2022-04-15 14:43:39 -04:00
parent e823e9f373
commit ec7c31ff76
No known key found for this signature in database
GPG Key ID: 9ADDD344F13057F6
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}