diff options
Diffstat (limited to 'src/library/scala/runtime/ExceptionHandling.cs')
-rw-r--r-- | src/library/scala/runtime/ExceptionHandling.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/library/scala/runtime/ExceptionHandling.cs b/src/library/scala/runtime/ExceptionHandling.cs new file mode 100644 index 0000000000..0a59308f99 --- /dev/null +++ b/src/library/scala/runtime/ExceptionHandling.cs @@ -0,0 +1,33 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id$ + +using System; +using scala; + +namespace scala.runtime { + + public abstract class RunTime { + + public interface Runnable { + void run(); + } + + public static Exception tryCatch(Runnable runnable) { + try { + runnable.run(); + return null; + } catch (Exception exception) { + return exception; + } + } + + } + +} |