Skip to content

Commit bf41e16

Browse files
committed
breaking: log warning instead of throwing error for unknown events
BREAKING CHANGE: Before, this code would throw an error ```js webhooks.on(woodstock, handler) ``` Now it logs a warning: `"woodstock" is not a known webhook name (https://developer.github.com/v3/activity/events/types/)`
1 parent a859805 commit bf41e16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

event-handler/on.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function receiverOn (state, webhookNameOrNames, handler) {
99
}
1010

1111
if (webhookNames.indexOf(webhookNameOrNames) === -1) {
12-
throw new Error(`${webhookNameOrNames} is not a valid webhook name`)
12+
console.warn(`"${webhookNameOrNames}" is not a known webhook name (https://developer.github.com/v3/activity/events/types/)`)
1313
}
1414

1515
if (!state.hooks[webhookNameOrNames]) {

0 commit comments

Comments
 (0)