Mihai Voicescu
02/17/2022, 9:38 AMPromise
?
try {
val p = window.navigator.mediaDevices.asDynamic()
.getDisplayMedia() as Promise<MediaStream>
console.log(p)
p.await()
} catch (e: Exception) {
console.error("Everything is fine")
console.error(e)
}
Mihai Voicescu
02/17/2022, 10:37 AMcatch (e:Exception)
also checks that the thrown exception is type Exception
.
JS errors are not, so catching JS exceptions requires catch (e: Throwable)
.John Coleman
02/17/2022, 10:39 AMMihai Voicescu
02/17/2022, 10:40 AMMihai Voicescu
02/17/2022, 10:41 AM