mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-22 19:16:39 +10:00
return errors in json format
This commit is contained in:
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user