From bc487d7908a2047b92ce5c1aa6b4cede7b199448 Mon Sep 17 00:00:00 2001 From: Andrey Mischenko Date: Mon, 20 Nov 2017 17:15:33 +0800 Subject: [PATCH] Log exception to console properly in `launch` coroutine builder --- frontend/src/org/jetbrains/common/coroutines.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/org/jetbrains/common/coroutines.kt b/frontend/src/org/jetbrains/common/coroutines.kt index c7f7ce9..b8cb4b4 100644 --- a/frontend/src/org/jetbrains/common/coroutines.kt +++ b/frontend/src/org/jetbrains/common/coroutines.kt @@ -17,5 +17,5 @@ fun async(block: suspend () -> T): Promise = Promise { resolve, reject } fun launch(block: suspend () -> Unit) { - async(block).catch { exception -> console.log("Failed with $exception") } -} \ No newline at end of file + async(block).catch { exception -> console.error(exception) } +}