Question about Rack middleware, exceptions, and Rails...

4 views
Skip to first unread message

Mel Riffe

unread,
Jun 21, 2013, 1:05:23 PM6/21/13
to cvr...@googlegroups.com, rub...@googlegroups.com
Howdy Folks,

I have a piece of middleware that is throwing an exception that I would like to handle. What's the best way for me to do this?

Specifically, I'm using the Apartment gem to implement multitenancy and it has some middleware that will automatically switch to a subdomain's schema when it detects the subdomain from the request. Well, that works fine when the intended subdomain has a schema in the database. It's kind of messy when there isn't a schema in the database.

Thanks!

--Mel

Mel Riffe

unread,
Jun 21, 2013, 2:04:29 PM6/21/13
to cvr...@googlegroups.com, rub...@googlegroups.com
You may ask! It would be the case where someone mistypes an address: first.example.com vs. fist.example.com

--Mel



On Fri, Jun 21, 2013 at 1:53 PM, Bob Larrick <lar...@gmail.com> wrote:
Dare I ask why sometimes there isn't a corresponding schema in the DB?


-Bob


--
You received this message because you are subscribed to the Google Groups "Central Virginia Ruby Enthusiasts Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cvruby+un...@googlegroups.com.
To post to this group, send email to cvr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cvruby.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Central Virginia Ruby Enthusiasts Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cvruby+un...@googlegroups.com.
To post to this group, send email to cvr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cvruby.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jamie Orchard-Hays

unread,
Jun 21, 2013, 2:08:29 PM6/21/13
to cvr...@googlegroups.com, rub...@googlegroups.com
Seems like your middleware should ask:

Is this a valid subdomain?

If it's not, then it stops the request, redirects to a 404 with a friendly message that the subdomain was the problem.
Reply all
Reply to author
Forward
0 new messages