Skip to content

Commit

Permalink
fix(js-utils): add logging for exception handling
Browse files Browse the repository at this point in the history
Signed-off-by: Art Shendrik <[email protected]>
  • Loading branch information
amal committed Nov 26, 2024
1 parent 47d9c55 commit 108c2eb
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions fluxo-kmp-conf/src/main/kotlin/KotlinJsUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,21 @@ public val DEFAULT_COMMON_JS_CONF: KotlinTarget.() -> Unit = {
testTimeout()
}
}
} catch (_: Throwable) {
} catch (e: Throwable) {
try {
project.logger.w("Failed to set up browser for target '$name': $e", e)
} catch (_: Throwable) {
}
}

@OptIn(ExperimentalKotlinGradlePluginApi::class)
try {
compilerOptions(JsConfAction)
} catch (_: Throwable) {
} catch (e: Throwable) {
try {
project.logger.w("Failed to set up compilerOptions for target '$name': $e", e)
} catch (_: Throwable) {
}
}

compilations.configureEach {
Expand Down Expand Up @@ -98,8 +106,15 @@ public val DEFAULT_COMMON_JS_CONF: KotlinTarget.() -> Unit = {

if (this is KotlinWasmJsTargetDsl) {
if (ENABLE_D8) {
d8 {
testTimeout()
try {
d8 {
testTimeout()
}
} catch (e: Throwable) {
try {
project.logger.w("Failed to set up d8 for target '$name': $e", e)
} catch (_: Throwable) {
}
}
}
// Apply Binaryen optimizer to the WASM target.
Expand Down

0 comments on commit 108c2eb

Please sign in to comment.