From dd5cf36eee28dcc23a46c94169e50de5a49da8b1 Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Sat, 26 Oct 2013 08:39:31 -0500 Subject: [PATCH] Handle JSON parsing errors --- lib/travis/api/app/base.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/travis/api/app/base.rb b/lib/travis/api/app/base.rb index 35e44766..082be3ea 100644 --- a/lib/travis/api/app/base.rb +++ b/lib/travis/api/app/base.rb @@ -19,6 +19,11 @@ class Travis::Api::App "This feature has not yet been implemented. Sorry :(\n\nPull Requests welcome!" end + error JSON::ParserError do + status 400 + "Invalid JSON in request body" + end + # hotfix?? def route_missing @app ? forward : halt(404)