plugin on web socket routes? I would like to throw an exceptions in all my routes and handle it from one place, this plugin by default only work with Http methods routes like get, post
But not web socket, is there an alternative solution?
👍 1
a
Aleksei Tirman [JB]
05/09/2024, 11:27 AM
Can you describe the problem you are trying to solve?
a
Ahmed Riyadh
05/09/2024, 11:33 AM
Thank you for the reply. I want an alternative of this plugin
https://ktor.io/docs/server-status-pages.html
But instead of using it only in http routes, I would like to use it in web socket routes, for example I have an exception
ErrorResponseException
that hold some variables (message, data etc...)
I already setup this easily using the status pages plugin, I can throw exceptions inside the route handler and handle them in one place (in the place where I install the plugin)
I want so when I throw an exception, it stop the route handler code execution and fallback to the code that will run for a specific exception
a
Aleksei Tirman [JB]
05/09/2024, 11:40 AM
There is no such functionality for WebSockets because the pipelines aren't involved in the WebSockets communication.
👍 2
Aleksei Tirman [JB]
05/09/2024, 3:31 PM
And unfortunately, I cannot find a central place where all those exceptions could be caught.