Chris, you can use rescue_from in your controller, something like

class ApplicationController < ActionController::Base
  rescue_from User::NotAuthorized, with: :deny_access # self defined exception
  rescue_from ActiveRecord::RecordInvalid, with: :show_errors

  rescue_from 'MyAppError::Base' do |exception|
    ...
  end
end



On Mon, Feb 10, 2014 at 11:04 AM, Chris McCann <[email protected]>wrote:

> One of my Rails apps sent me this exception notification:
>
> A ActionView::MissingTemplate occurred in site#about:
>
>   Missing template site/about.erb in view path app/views
>
> -------------------------------
> Request:
> -------------------------------
>
>   * URL       : 
> http://myapp.example/site/about/register.php<http://myapp.example.com/site/about/register.php>
>   * Parameters: {"format"=>"php", "action"=>"about", "id"=>"register",
> "controller"=>"site"}
>
> My google-fu is weak on this one -- what's a good way to prevent this type
> of bogus request from throwing an exception application-wide?
>
> Cheers,
>
> Chris
>
> --
> --
> SD Ruby mailing list
> [email protected]
> http://groups.google.com/group/sdruby
> ---
> You received this message because you are subscribed to the Google Groups
> "SD Ruby" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
--- 
You received this message because you are subscribed to the Google Groups "SD 
Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to