title: vert.x: Register failureHandler to all routes
body: <p>In my app I have routes like:</p>
  <pre><code>router.get &quot;/api/$name/:id&quot; handler this.&amp;details
  router.post &quot;/api/$name&quot; consumes JSON produces JSON handler this.&amp;save
  router.delete &quot;/api/$name/:id&quot; handler this.&amp;delete
  // a lot more of those
  </code></pre>
  <p>I want to register a <code>failureHandler</code> to all of those routes, to do simple error logging like:</p>
  <pre><code>void handleError( RoutingContext rc ) {
      Throwable failure = rc.failure()
      log.error failure.message, failure
      rc.response().setStatusCode 500 putHeader 'content-type', JSON end &quot;&quot;&quot;{ &quot;message&quot;:&quot;$failure.message&quot;}&quot;&quot;&quot;
  }
  </code></pre>
  <p>The doc shows, that I can register the <code>failureHandler</code> on per-route basis like so:</p>
  <pre><code>router.get &quot;/api/$name/:id&quot; handler this.&amp;details failureHander this.&amp;handleError
  </code></pre>
  <p>which would become pretty verbose and self-repeating very soon.</p>
  <p>I tried to register a handler on a wildcard path:</p>
  <pre><code>router.route '/*' failureHandler this.&amp;handleError
  </code></pre>
  <p>but that is ignored.</p>
  <p>Is there a way to register a global <code>failureHandler</code>?</p>