Commit 216cc9ef authored by Mygod's avatar Mygod

Refine #574

parent 3bb74625
...@@ -2,17 +2,16 @@ package com.github ...@@ -2,17 +2,16 @@ package com.github
import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future import scala.concurrent.Future
import scala.util.{Success, Failure, Try} import scala.util.{Failure, Try}
/** /**
* @author Mygod * @author Mygod
*/ */
package object shadowsocks { package object shadowsocks {
private val handleFailure: Try[_] => Unit = {
val handleFailure: PartialFunction[Try[_], Unit] = {
case Success(_) =>
case Failure(e) => e.printStackTrace() case Failure(e) => e.printStackTrace()
case _ =>
} }
def ThrowableFuture[T](f: => T) = Future(f) onComplete handleFailure def ThrowableFuture[T](f: => T) = Future(f) onComplete handleFailure
} }
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment