Kotlin try
try { // some code } catch (e: SomeException) { // handler } finally { // optional finally block }
Source: kotlinlang.org
try catch kotlin
try{ // wirte here somethin that you thought it would throw expection } catch(e:Expection){ e.printstacktrace() // handle expection or write upper line of code } finally{ // this block is optional // this will always run if expection come or not }
kotlin try catch
try { // some code } catch (e: SomeException) { // handler } finally { // optional finally block }