Commit 1d2c9818 authored by Nihad Abbasov's avatar Nihad Abbasov

return errors in json format

parent 0d67f209
...@@ -3,6 +3,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file} ...@@ -3,6 +3,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file}
module Gitlab module Gitlab
class API < Grape::API class API < Grape::API
format :json format :json
error_format :json
helpers APIHelpers helpers APIHelpers
mount Users mount Users
......
...@@ -5,7 +5,7 @@ module Gitlab ...@@ -5,7 +5,7 @@ module Gitlab
end end
def authenticate! def authenticate!
error!('401 Unauthorized', 401) unless current_user error!({'message' => '401 Unauthorized'}, 401) unless current_user
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment