summaryrefslogtreecommitdiff
path: root/src/dotnet-library/scala/runtime/ExceptionHandling.cs
blob: 4448777f2e81bc9a0c18636973aee6df927f0b02 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2002-2007, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |                                         **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

// $Id$

namespace scala.runtime {

  using System;

  public abstract class ExceptionHandling {

    public static Exception tryCatch(Runnable runnable) {
      try {
        runnable.run();
        return null;
      } catch (Exception exception) {
        return exception;
      }
    }
  }

}