Hans van Dodewaard
06/03/2024, 4:18 PMHans van Dodewaard
06/04/2024, 11:25 AMval localDi = localDI()
window.asDynamic().onerror = { message: dynamic, _: dynamic, _: dynamic, _: dynamic, _: dynamic ->
handleError(localDi, message)
true
}
fun handleError(di:DI, message:String) {
// store message in sessionStorage
...
CoroutineScope(Dispatchers.Main).launch {
// save data to server or indexedD
...
// redirect to error page
window.location.href = "/error.html"
}
}
But this will still show the default "Uncaught runtime errors" page for a second or so.
It would be nice if we could overrule the default runtime error handling of Compose HTML.