4 ms·
> "I felt a bit odd using exceptions as the core of this workflow..." i've done something analogous before and it seemed to me the exception framework was the
by clairity 6y ago
> "I felt a bit odd using exceptions as the core of this workflow..."
i've done something analogous before and it seemed to me the exception framework was the right abstraction to use (though other opinions are welcome!). in this particular case, it seems like the main problem is that the trigger exceptions are not sufficiently granular/appropriate to describe the exact exception condition on which to trigger read-only mode:
* ActiveRecord::StatementInvalid
* PG::InsufficientPrivilege
rather than "DatabaseDownForMaintenance".