return errors in json format
This commit is contained in:
parent
0d67f209fc
commit
1d2c981860
2 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue