add logging and error when notify errors
All checks were successful
Build and push image for doorman-homeassistant / docker (push) Successful in 24s
Build and push Doorman UI / API / docker (push) Successful in 1m22s
Build and push image for doorman-homeassistant / deploy-gitainer (push) Successful in 23s

This commit is contained in:
Martin Dimitrov 2024-11-11 19:58:05 -08:00
parent 6cd44c2667
commit 321ace5b4a

View File

@ -18,7 +18,7 @@ exports.handler = async function(context, event, callback) {
let users = event.discordUser; let users = event.discordUser;
let msgs = event.msg; let msgs = event.msg;
let jsons = event.json; let jsons = event.json;
let promises; let promises = [];
try { try {
users = JSON.parse(users); users = JSON.parse(users);
@ -34,6 +34,11 @@ exports.handler = async function(context, event, callback) {
); );
} catch (e) { } catch (e) {
console.error(e); console.error(e);
response
.setStatusCode(500)
.appendHeader('Content-Type', 'application/json')
.setBody({ err: e, event });
return callback(null, response);
} }
setTimeout(() => { setTimeout(() => {