swap warning for error

@gillespi314 btw you did this exactly right, I just realized when I tested this out (after realizing I had it configured wrong in prod) that I should have recommended an error instead of a warning
This commit is contained in:
Mike McNeil 2021-05-13 09:24:53 -05:00 committed by GitHub
parent 74b4cd535f
commit 32b4d53e7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ module.exports = {
fn: async function({emailAddress, topic, firstName, lastName, message}) { fn: async function({emailAddress, topic, firstName, lastName, message}) {
if (!sails.config.custom.slackWebhookUrlForContactForm) { if (!sails.config.custom.slackWebhookUrlForContactForm) {
sails.log.warn( throw new Error(
'Message not delivered: slackWebhookUrlForContactForm needs to be configured in sails.config.custom. Here\'s the undelivered message: ' + 'Message not delivered: slackWebhookUrlForContactForm needs to be configured in sails.config.custom. Here\'s the undelivered message: ' +
`Name: ${firstName + ' ' + lastName}, Email: ${emailAddress}, Topic: ${topic}, Message: ${message ? message : 'No message.'}` `Name: ${firstName + ' ' + lastName}, Email: ${emailAddress}, Topic: ${topic}, Message: ${message ? message : 'No message.'}`
); );