Skip to content

Commit

Permalink
[observability] print errors when page creation fails (#1619)
Browse files Browse the repository at this point in the history
The problem: 
detailed Errors are not showing on referrals.restarone.com
 
![Screenshot from 2023-10-11 16-16-16](https://github.com/restarone/violet_rails/assets/35935196/417bdfb4-f9bc-4881-ba72-15df3b4b2702)



print detailed errors when page creation fails

![Screenshot from 2023-10-11 16-09-45](https://github.com/restarone/violet_rails/assets/35935196/65b70163-abe9-4538-846b-04fb086da325)
  • Loading branch information
donrestarone authored Oct 11, 2023
1 parent c5299c1 commit ed4656f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/comfy/admin/cms/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def create
flash[:success] = I18n.t("comfy.admin.cms.pages.created")
redirect_to action: :edit, id: @page
rescue ActiveRecord::RecordInvalid
flash.now[:danger] = I18n.t("comfy.admin.cms.pages.creation_failure")
flash.now[:danger] = "#{I18n.t("comfy.admin.cms.pages.creation_failure")} because: #{@page.errors.full_messages.to_sentence}"
render action: :new
end

Expand Down

0 comments on commit ed4656f

Please sign in to comment.