lib/apimaster/controllers/errors.rb in apimaster-0.1.3 vs lib/apimaster/controllers/errors.rb in apimaster-0.1.4
- old
+ new
@@ -19,10 +19,14 @@
messages[:errors] = [error] unless error.empty?
json messages
end
superclass.error do
- raise env['sinatra.error'] if development?
+ if respond_to?(:development?)
+ raise env['sinatra.error'] if development?
+ elsif settings.respond_to?(:development?)
+ raise env['sinatra.error'] if settings.development?
+ end
json :message => "Internal Server Error"
end
superclass.not_found do
json message: "Not Found"