diff --git a/lib/api.rb b/lib/api.rb index 5cc78e5..6882615 100644 --- a/lib/api.rb +++ b/lib/api.rb @@ -3,6 +3,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file} module Gitlab class API < Grape::API format :json + error_format :json helpers APIHelpers mount Users diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index cd2e39b..424a17b 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -5,7 +5,7 @@ module Gitlab end def authenticate! - error!('401 Unauthorized', 401) unless current_user + error!({'message' => '401 Unauthorized'}, 401) unless current_user end end end -- libgit2 0.21.2