-
Notifications
You must be signed in to change notification settings - Fork 498
Closed
Description
Sinatra's doc used : http://sinatra-book.gittr.com/#error_handling
In some models, i raise a Picture::NotFound exception :
class Picture
...
class NotFound < Exception
end
def initialize
...
raise Picture::NotFound, "Picture #{path} not found" unless File.file?(self.physical_path)
end
end
And in app/app.rb :
class Picty < Padrino::Application
...
error Picture::NotFound do
render :haml, "%p Picture not found"
end
end
All I get in the logs is the usual not catched exeption message :
Picture::NotFound - Picture /A1/Ext/IMG_52fdsf46.jpg not found:
/home/renchap/dev/Picty/app/models/picture.rb:22:in `initialize'
Is it normal that this Sinatra behaviour does not work with Padrino ? I think this is very useful, and wish to be able to use it.
I tried to move the error ... declaration to the controller, but it does not work either.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels