code: def _catchall_enabled(app):
      
      while hasattr(app, 'app'):
          if isinstance(app, bottle.Bottle):
              break
          app = app.app
      if hasattr(app, 'catchall'):
          return app.catchall
      else:
          return bottle.default_app().catchall
docs: Check the bottle app for catchall.