title: How to override Rails 3.1 "Routing Error" when using engines with glob routes?
body: <p>I'm converting a legacy app to Rails 3.1.  The new app uses an engine that provides a glob route:</p>
  
  <pre><code># myengine/config/routes.rb
  Rails.application.routes.draw do
    match 'foo/bar/*path' =&gt; 'myengine/foobar#index', :format =&gt; false
  end
  </code></pre>
  
  <p>The legacy app used a final catchall wildcard route to provide custom handling (rather than the familiar Rails "Routing Error" page) for otherwise unmatched routes:</p>
  
  <pre><code># myapp/config/routes.rb
  Myapp::application.routes.draw do
    # ...
    match '*path' =&gt; 'failures#index', :format =&gt; false
  end
  </code></pre>
  
  <p>Somehow this catchall route is interfering with the engine's route.  If I comment out the app's catchall route, the engine's route works fine.  But if I leave it in the engine route is never matched and the app's catchall route to <code>failures#index</code> is used instead:</p>
  
  <pre><code>Started GET "/foo/bar//projects/x/vol1/prod22/9907042031/9907042031.aff/ImageProperties.xml" for 10.71.1.136 at 2011-08-02 15:46:48 -0700
    Processing by FailuresController#index as JS
    Parameters: {"path"=&gt;"foo/bar/projects/x/vol1/prod22/9907042031/9907042031.aff/ImageProperties.xml"}
  Rendered failures/index.html.erb within layouts/application (0.0ms)
  Completed 200 OK in 47ms (Views: 46.9ms)
  </code></pre>
  
  <p>How would one override the default Rails 3.1 routing error handler without breaking engine routes?</p>