improve exception handling in TorVPN Service
catch onionmasq exceptions directly on the coroutine scope, use launch
instead of async
therefore to start coroutines
Some context:
Before the onionmasq exceptions were not properly handled, since they got stored in async
's Deferred
object, which we silently dropped here (we didn't assign a variable to the async
block and awaited for the result in order to handle either the result or the exception).
launch
is more of a fire-and-forget approach, any exceptions need to be handled directly in the code block, otherwise the app would crash.
Edited by cyberta