RoutingError raised in ContentController# not rescued in Rails 4.1

48 views
Skip to first unread message

Janusz M

unread,
Jun 24, 2015, 7:29:34 AM6/24/15
to comfortable-...@googlegroups.com

I recently upgraded a legacy app from Rails 3 to 4 and CMS 1.8 to 1.12. I've noticed that the code in the app's ApplicationController used to rescue from errors is NOT executed:

rescue_from ActionController::RoutingError, ActiveRecord::RecordNotFound do |exception|
  render template: '/errors/page_not_found', status: 404
end

Instead, I get an error page in Dev env and blank page in Prod.

Here's the code in CMS that raises RoutingError

def page_not_found
  @cms_page = @cms_site.pages.published.find_by_full_path!('/404')

   respond_to do |format|
     format.html { render_page(404) }
   end
rescue ActiveRecord::RecordNotFound
  raise ActionController::RoutingError.new("Page Not Found at: \"#{params[:cms_path]}\"")
end

Does it seem like an issue with CMS, perhaps error raised here cannot be caught by ApplicationController again? Or do you think that I should search for a problem in Rails 4.1 ?

Message has been deleted

Janusz M

unread,
Jun 24, 2015, 8:45:56 AM6/24/15
to comfortable-...@googlegroups.com
UPDATE: perhaps it's more like an application concern? Docs for rescue_from say that since Rails version 4.0

Exceptions raised inside exception handlers are not propagated up.

If so, then should we modify page_not_found method to call somehow the global rescue_from (if possible at all)?

Banks Dollar

unread,
Apr 26, 2024, 3:13:16 PM4/26/24
to comfortable-mexican-sofa
Buy Your Psychedelic Products Here Safely
DMT is the active ingredient in ayahuasca, a traditional South American brewed tea and is used for its psychoactive, hallucinogenic effects. “Spiritual insight” is one of the most commonly reported positive side effects of the drug.
.5mL
400mg DMT
Spirit molecule psychedelic experience
Cartridge.
https://t.me/Ttrippy75/199
https://t.me/Ttrippy75/192
https://t.me/Ttrippy75/191
https://t.me/Ttrippy75/190
https://t.me/Ttrippy75/171
https://t.me/Ttrippy75/145
https://t.me/Ttrippy75/143
https://t.me/Ttrippy75/141
https://t.me/Ttrippy75/121
https://t.me/Ttrippy75/110
https://t.me/Ttrippy75/108
https://t.me/Ttrippy75/100
https://t.me/Ttrippy75/102
https://t.me/Ttrippy75/98
https://t.me/Ttrippy75/728
https://t.me/Ttrippy75/725
https://t.me/Ttrippy75/722
https://t.me/Ttrippy75/721


DMT is the active ingredient in ayahuasca, a traditional South American brewed tea and is used for its psychoactive, hallucinogenic effects. “Spiritual insight” is one of the most commonly reported positive side effects of the drug.
1mL
800mg DMT
Spirit molecule psychedelic experience
Vape and cartridge included
You’ll be in the magical colourful dimension of Dimitrys Magic Stick,
Many Benefits Come With The Consumption Of The DMT Microdose 4-ACO-Microdosing/4-Acetoxy-N,N-Dimethyltryptamine (Psilacetin Or 4-AcO-DMT) And its
creates a feeling of peace and relaxation in the mind and body.
https://t.me/Ttrippy75/426
https://t.me/Ttrippy75/356
https://t.me/Ttrippy75/316
https://t.me/Ttrippy75/287
https://t.me/Ttrippy75/270
https://t.me/Ttrippy75/269
https://t.me/Ttrippy75/266
https://t.me/Ttrippy75/234
https://t.me/Ttrippy75/204
https://t.me/Ttrippy75/719
https://t.me/Ttrippy75/717
https://t.me/Ttrippy75/661
https://t.me/Ttrippy75/608
https://t.me/Ttrippy75/605
https://t.me/Ttrippy75/588
https://t.me/Ttrippy75/587
https://t.me/Ttrippy75/586
https://t.me/Ttrippy75/580

Guaranteed Shipping all Over the States,Australia, Europe.
Reply all
Reply to author
Forward
0 new messages