Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Avoid error when slack_username is not defined #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

albertollamaso
Copy link

When the envrionent variable slack_username is not defined it throws this error:

(node:1) UnhandledPromiseRejectionWarning: Error: Configuration property "slack_username" is not defined
    at Config.get (/app/node_modules/config/lib/config.js:182:11)
    at SlackNotifier.notify (/app/notify/slack.js:26:48)
    at PodLongNotReady.callback (/app/index.js:27:26)
    at PodLongNotReady.emit (events.js:198:13)
    at PodLongNotReady.check (/app/monitors/longnotready.js:65:18)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

With this commit we avoid this error if this environment variable is not defined

    When the envrionent variable slack_username is not defined it throws this error:

    (node:1) UnhandledPromiseRejectionWarning: Error: Configuration property "slack_username" is not defined
        at Config.get (/app/node_modules/config/lib/config.js:182:11)
        at SlackNotifier.notify (/app/notify/slack.js:26:48)
        at PodLongNotReady.callback (/app/index.js:27:26)
        at PodLongNotReady.emit (events.js:198:13)
        at PodLongNotReady.check (/app/monitors/longnotready.js:65:18)
        at process._tickCallback (internal/process/next_tick.js:68:7)
    (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

    With this commit we avoid this error if this environment variable is not defined
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant