src/Pure/General/exn.scala
changeset 72596 b2bbe2e6575d
parent 72335 b8708212bdd5
child 73340 0ffcad1f6130
equal deleted inserted replaced
72595:c806eeb9138c 72596:b2bbe2e6575d
    91     try { Res(e) }
    91     try { Res(e) }
    92     catch { case exn: Throwable if !is_interrupt(exn) => Exn[A](exn) }
    92     catch { case exn: Throwable if !is_interrupt(exn) => Exn[A](exn) }
    93 
    93 
    94   object Interrupt
    94   object Interrupt
    95   {
    95   {
       
    96     object ERROR
       
    97     {
       
    98       def unapply(exn: Throwable): Option[String] =
       
    99         if (is_interrupt(exn)) Some(message(exn)) else user_message(exn)
       
   100     }
       
   101 
    96     def apply(): Throwable = new InterruptedException("Interrupt")
   102     def apply(): Throwable = new InterruptedException("Interrupt")
    97     def unapply(exn: Throwable): Boolean = is_interrupt(exn)
   103     def unapply(exn: Throwable): Boolean = is_interrupt(exn)
    98 
   104 
    99     def dispose() { Thread.interrupted }
   105     def dispose() { Thread.interrupted }
   100     def expose() { if (Thread.interrupted) throw apply() }
   106     def expose() { if (Thread.interrupted) throw apply() }