Is there any proper way to handle validation exceptions in @OnOpen method? #5320
Unanswered
domi-nika60
asked this question in
Q&A
Replies: 1 comment 7 replies
-
You would need to add an |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Just wondering if there is any way to handle exceptions in Websocket server onOpen method.
In my project I introduced validation of the parameters being sent via websocket connection.
Something like this:
And in WebsocketClient class:
When the
id
is not valid, there is an exception on OnOpen method with all stacktrace. I was trying to handle it in any way. Most reasonable was to add:(from https://guides.micronaut.io/micronaut-error-handling/guide/index.html)
And use this execption to be logged.
But then there is an error
Is there any other proper way to handle validation exceptions in @onopen methods?
Maybe it is a bug?
Beta Was this translation helpful? Give feedback.
All reactions