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}
module Gitlab
class API < Grape::API
format :json
error_format :json
helpers APIHelpers
mount Users
......
......@@ -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
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