Class: Aho::WebServer::Application
- Inherits:
-
Object
- Object
- Aho::WebServer::Application
- Defined in:
- lib/aho/web_server/application.rb
Instance Method Summary collapse
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/aho/web_server/application.rb', line 8 def call(env) Aho.router.route_for(env) || [404, {}, []] rescue Api::MissingFieldError, Api::InvalidTypeError => e bad_request_error(error: e) rescue JSON::ParserError => e common_error(error: e, status_code: 400) rescue StandardError => e common_error(error: e, status_code: 500) end |