Hello! What is the best way to handle cancellation...
# coroutines
p
Hello! What is the best way to handle cancellation excaptions? If silently rethrow them, can miss real exception. If catch - normal cancellation will be treated as exception.
b
How can you miss real exceptions? Cancellation exception is not supposed to be used for real exceptions. In most of the cases you need to re-throw them, unless you intentionally want to break cooperativeness
e
Always rethrow cancellation exceptions. Any other exception, you can choose how to handle yourself as thats up to your business needs. But not throwing cancellations can cause memory leaks and have other operations running after a caught cancellation