1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 12:49:43 +02:00

fix: Fix error output when sending email or message to Slack

This commit is contained in:
Maksim Eltyshev 2024-04-12 12:07:19 +02:00
parent aca849999e
commit d9b17d72f9
3 changed files with 6 additions and 6 deletions

View file

@ -20,7 +20,7 @@ const mapStateToProps = (state) => {
isSubmittingUsingOidc,
error,
withOidc: !!oidcConfig,
isOidcEnforced: oidcConfig && oidcConfig.isEnforced,
isOidcEnforced: !!oidcConfig && oidcConfig.isEnforced,
};
};

View file

@ -23,9 +23,9 @@ module.exports = {
from: sails.config.custom.smtpFrom,
});
sails.log.info('Email sent: %s', info.messageId);
sails.log.info(`Email sent: ${info.messageId}`);
} catch (error) {
sails.log.error(error); // TODO: provide description text?
sails.log.error(`Error sending email: ${error}`);
}
},
};

View file

@ -35,19 +35,19 @@ module.exports = {
body: JSON.stringify(body),
});
} catch (error) {
sails.log.error(error); // TODO: provide description text?
sails.log.error(`Error sending to Slack: ${error}`);
return;
}
if (!response.ok) {
sails.log.error('Error sending to Slack: %s', response.error);
sails.log.error(`Error sending to Slack: ${response.error}`);
return;
}
const responseJson = await response.json();
if (!responseJson.ok) {
sails.log.error('Error sending to Slack: %s', responseJson.error);
sails.log.error(`Error sending to Slack: ${responseJson.error}`);
}
},
};