Skip to content

Commit 9e6cd2d

Browse files
committed
Issues-129
1 parent e4a4c81 commit 9e6cd2d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/modules/user_management/helpers.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ function processPayload (payload, topic) {
3030
action: constants.USER_ACTIONS.KICK
3131
}
3232
case constants.KAFKA.TOPICS.CHALLENGE_NOTIFICATION_TOPIC:
33+
if (!(payload.type in actionMap)) {
34+
throw new Error(`Not supported ${payload.type}. Only message types ${JSON.stringify(Object.keys(eventTypes))} are processed from '${topic}'`)
35+
}
3336
return {
3437
challengeId: payload.data.challengeId,
3538
userId: payload.data.userId,
3639
action: actionMap[payload.type]
3740
}
3841
default:
39-
throw new Error('Received message from unrecognized topic')
42+
throw new Error(`Received message from unrecognized '${topic}'`)
4043
}
4144
}
4245

0 commit comments

Comments
 (0)