From f1a7efc97ea4eb4305836a3fb1713a72cc12ac94 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Fri, 4 Jan 2019 09:01:13 -0800 Subject: Return void and throw error instead of logging and returning boolean --- packages/monorepo-scripts/src/utils/discord.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'packages') diff --git a/packages/monorepo-scripts/src/utils/discord.ts b/packages/monorepo-scripts/src/utils/discord.ts index ed10b1cc3..2f3afef45 100644 --- a/packages/monorepo-scripts/src/utils/discord.ts +++ b/packages/monorepo-scripts/src/utils/discord.ts @@ -4,11 +4,10 @@ import { constants } from '../constants'; import { utils } from './utils'; -export const alertDiscordAsync = async (releaseNotes: string): Promise => { +export const alertDiscordAsync = async (releaseNotes: string): Promise => { const webhookUrl = constants.discordAlertWebhookUrl; if (!webhookUrl) { - utils.log('Not alerting to discord because webhook url not set'); - return false; + throw new Error("No discord webhook url, can't alert"); } utils.log('Alerting discord...'); @@ -23,5 +22,5 @@ export const alertDiscordAsync = async (releaseNotes: string): Promise }, body: JSON.stringify(payload), }); - return true; + return; }; -- cgit