Skip to content

How to return custom error code if onSubscribe throws an error ? #167

Answered by enisdenjo
97amarnathk asked this question in Q&A
Discussion options

You must be logged in to vote

Answered in full detail here: #166 (reply in thread).

TL;DR to close the socket manually with whatever close event you wish, you simply use the socket in the context. Something like context.extra.socket.close(4401, 'Unauthorized').

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@97amarnathk
Comment options

@enisdenjo
Comment options

@enisdenjo
Comment options

@97amarnathk
Comment options

@enisdenjo
Comment options

Answer selected by 97amarnathk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants