title: Dart catch clause
body: <p>I recently stumbled across the following Dart code:</p>
  
  <pre><code>void doSomething(String url, String method) {
      HttpRequest request = new HttpRequest();
  
      request.open(method, url);
      request.onLoad.listen((event) {
          if(request.status &lt; 400) {
              try {
                  String json = request.responseText;
              } catch(e) {
                  print("Error!");
              }
          } else {
              print("Error! (400+)");
          }
      });
  
      request.setRequestHeader("Accept", ApplicationJSON);
  }
  </code></pre>
  
  <p>I'm wondering what the <code>e</code> variable is in the catch clause:</p>
  
  <pre><code>catch(e) {
      ...
  }
  </code></pre>
  
  <p><a href="http://news.dartlang.org/2012/08/new-exception-syntax-ready-to-use.html" rel="noreferrer">Obviously its some sort of exception</a>, but (1) why do we not need to specify its type, and (2) what could I add in there to specify its concrete type? For instance, how could I handle multiple types of possible exceptions in a similar way to <code>catchError(someHandler, test: (e) =&gt; e is SomeException)</code>?</p>