diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2019-01-05 01:01:13 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2019-01-05 01:01:13 +0800 |
commit | f1a7efc97ea4eb4305836a3fb1713a72cc12ac94 (patch) | |
tree | 70dd043163a45b947ad06b50464251964cccb8dc /packages/monorepo-scripts | |
parent | 442de09bbe36cb4a1c2d32cca6e65aee710f6382 (diff) | |
download | dexon-sol-tools-f1a7efc97ea4eb4305836a3fb1713a72cc12ac94.tar dexon-sol-tools-f1a7efc97ea4eb4305836a3fb1713a72cc12ac94.tar.gz dexon-sol-tools-f1a7efc97ea4eb4305836a3fb1713a72cc12ac94.tar.bz2 dexon-sol-tools-f1a7efc97ea4eb4305836a3fb1713a72cc12ac94.tar.lz dexon-sol-tools-f1a7efc97ea4eb4305836a3fb1713a72cc12ac94.tar.xz dexon-sol-tools-f1a7efc97ea4eb4305836a3fb1713a72cc12ac94.tar.zst dexon-sol-tools-f1a7efc97ea4eb4305836a3fb1713a72cc12ac94.zip |
Return void and throw error instead of logging and returning boolean
Diffstat (limited to 'packages/monorepo-scripts')
-rw-r--r-- | packages/monorepo-scripts/src/utils/discord.ts | 7 |
1 files changed, 3 insertions, 4 deletions
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<boolean> => { +export const alertDiscordAsync = async (releaseNotes: string): Promise<void> => { 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<boolean> }, body: JSON.stringify(payload), }); - return true; + return; }; |