We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dear Team,
I tryed to catch all exceptions by error do ... end block, but I found the code like below:
error do ... end
class App < Padrino::Application #... configure :production do error ::Exception do Padrino.logger.error "Catching #{env['sinatra.error'].class}." # some logging... erb :'errors/500' end end end
doesn't work on production.
I guess this is because the error ::Exception do ... end block is overrided by Padrino::Application.default_errors!
error ::Exception do ... end
https://github.com/padrino/padrino-framework/blob/master/padrino-core/lib/padrino-core/application.rb#L212
And for example, this code works.
class App < Padrino::Application #... def self.default_errors! configure :production do error ::Exception do Padrino.logger.error "Catching #{env['sinatra.error'].class}." # some logging... erb :'errors/500' end end end end
I hope Padrino::Application.default_errors! won't override the "::Exception" error block when error Exception do is already declared.
error Exception do
Thank you, Uchio Kondo
The text was updated successfully, but these errors were encountered:
@udzura try with this:
error 500 do ...
Sorry, something went wrong.
8daec1d
Thanks for advise, and an elegant commit!
No branches or pull requests
Dear Team,
I tryed to catch all exceptions by
error do ... end
block, but I found the code like below:doesn't work on production.
I guess this is because the
error ::Exception do ... end
block is overrided by Padrino::Application.default_errors!https://github.com/padrino/padrino-framework/blob/master/padrino-core/lib/padrino-core/application.rb#L212
And for example, this code works.
I hope Padrino::Application.default_errors! won't override the "::Exception" error block when
error Exception do
is already declared.Thank you,
Uchio Kondo
The text was updated successfully, but these errors were encountered: