status, headers, body = @app.call(env) [status, headers, body] rescue Esplanade::Request::NotDocumented [ 200, {'Content-Type' => 'application/json; charset=utf-8'}, [{status: :incorrectRequest, error: :requestNotDocumented}.to_json] ] rescue Esplanade::Request::BodyIsNotJson [ 200, {'Content-Type' => 'application/json; charset=utf-8'}, [{status: :incorrectRequest, error: :requestBodyIsNotJson}.to_json] ] rescue Esplanade::Request::Invalid => e [ 200, {'Content-Type' => 'application/json; charset=utf-8'}, [{status: :incorrectRequest, error: :requestBodylsInvalid, details: e}.to_json] ] end end 45