我正在使用这间公寓作为红宝石。
我在 application.rb 文件中添加了这个:
config.middleware.use 'Apartment::Elevators::Subdomain'
当我尝试在 PostgreSQL 中不存在子域 'test' 模式的浏览器 url 'test.domain.local:3000' 中点击这个时,我看到了这个错误
Apartment::SchemaNotFound (One of the following schema(s) is invalid: test, "public")
我知道这是 gem 的正常行为,但想捕获此异常并将用户重定向到其他页面,我该怎么做?