From c52274cd5942995783ec2eeaf1cb4f95624af61d Mon Sep 17 00:00:00 2001 From: Pierre-Gilles Leymarie Date: Fri, 11 Oct 2024 10:16:46 +0900 Subject: [PATCH] Improve error logging (google home + instance get access token) (#168) --- core/api/google/google.model.js | 2 +- core/api/instance/instance.model.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/api/google/google.model.js b/core/api/google/google.model.js index 83d4cbf..e03ff61 100644 --- a/core/api/google/google.model.js +++ b/core/api/google/google.model.js @@ -177,7 +177,7 @@ module.exports = function GoogleHomeModel(logger, db, redisClient, jwtService) { }); } catch (e) { const status = get(e, 'response.status'); - logger.error(`GOOGLE_HOME_REPORT_STATE_ERROR, user = ${users[0].id}, status = ${status}`); + logger.debug(`GOOGLE_HOME_REPORT_STATE_ERROR, user = ${users[0].id}, status = ${status}`); if (status !== 404) { logger.info(get(e, 'response.data')); logger.info(payloadCleaned); diff --git a/core/api/instance/instance.model.js b/core/api/instance/instance.model.js index 3a57663..ad1cbd2 100644 --- a/core/api/instance/instance.model.js +++ b/core/api/instance/instance.model.js @@ -124,7 +124,7 @@ module.exports = function InstanceModel(logger, db, redisClient, jwtService, fin // the instance doesn't exist or has been deleted if (instanceInDb === null) { - throw new ForbiddenError(); + throw new ForbiddenError(`Instance ${instance.id} doesn't exist or has been deleted.`); } const accessToken = jwtService.generateAccessTokenInstance(instanceInDb);