Built in "Timeout Exception"
348
Views
2
Comments
New
Other

As a developer,

I would like to have a built in timeout exception,

So that I can do logic related to this specific exception.


Imagine a scenario where I am implementing a circuit breaker pattern so that I can stop calling an external service if it times out X amount of times. 

In the server context, to know if the service has timed out, we need to have an "All Exception" handler and check for the message

"The operation has timed out"

Checking for an hardcoded string is obviously not great, and could be easily solved by adding a built in exception



Hi Tiago,

I think you are missing the Communication Exception which is exactly about connection and timeout. Check this documentation here.

Regards,

Leandro

Hello Leandro,


That is true but only for reactive and mobile apps - "Communication Exceptions apply only to Reactive Web and Mobile Apps (....)"

I'm looking for something in the server side, which I believe is not possible at the moment.

Let me know if I'm missing something, thank you!


Changed the category to
Other