Advertisement
Guest User

exception handling

a guest
Nov 15th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.63 KB | None | 0 0
  1.   @JvmStatic
  2.         fun main(args: Array<String>)
  3.         {
  4.             launch()
  5.             {
  6.                 try
  7.                 {
  8.                     async()
  9.                     {
  10.                         println("async start")
  11.                         throw Exception("aaa")
  12.                         10
  13.  
  14.                     }.await()
  15.                 }
  16.                 catch (e: Exception)
  17.                 {
  18.                     println("async exception")
  19.                 }
  20.  
  21.                 println("after exception remaining code")
  22.             }
  23.             println("main end")
  24.             Thread.sleep(1000)
  25.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement