diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /lib/api/composer_packages.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'lib/api/composer_packages.rb')
-rw-r--r-- | lib/api/composer_packages.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/api/composer_packages.rb b/lib/api/composer_packages.rb index 31d097c4bea..1becbd668a3 100644 --- a/lib/api/composer_packages.rb +++ b/lib/api/composer_packages.rb @@ -2,7 +2,7 @@ # PHP composer support (https://getcomposer.org/) module API - class ComposerPackages < Grape::API::Instance + class ComposerPackages < ::API::Base helpers ::API::Helpers::PackagesManagerClientsHelpers helpers ::API::Helpers::RelatedResourcesHelpers helpers ::API::Helpers::Packages::BasicAuthHelpers @@ -26,6 +26,10 @@ module API render_api_error!(e.message, 400) end + rescue_from Packages::Composer::ComposerJsonService::InvalidJson do |e| + render_api_error!(e.message, 422) + end + helpers do def packages strong_memoize(:packages) do @@ -123,7 +127,7 @@ module API bad_request! end - package_event('push_package') + track_package_event('push_package', :composer) ::Packages::Composer::CreatePackageService .new(authorized_user_project, current_user, declared_params) |