We had an action that was essentially failing silently in production because it was raising an ActiveRecord::RecordNotFound
error, which Rails treats as a 404 error instead of a 500 error- meaning it wasn't being captured by our error logger.
I don't like that Rails maps certain errors to 404s- I think it should be up to the developer to decide whether a URL is invalid, or whether the failure to retrieve an record is an application error.
How do we ensure all Rails errors are treated as 500 errors?