diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-05-12 19:16:22 +0300 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-05-12 19:16:22 +0300 |
commit | f38779c6f521e0d554303db0619bafb07ffeda29 (patch) | |
tree | befebd8896c170355b1bb9d570cad92621eaa6c8 /app/controllers | |
parent | 2a89d2c97dee52121747f933c5786dbf3d78647e (diff) |
Respond with 404 when metrics are not enabled or deployment_metrics is not implemented
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/deployments_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/deployments_controller.rb b/app/controllers/projects/deployments_controller.rb index 83e9c7a3f1d..6644deb49c9 100644 --- a/app/controllers/projects/deployments_controller.rb +++ b/app/controllers/projects/deployments_controller.rb @@ -11,13 +11,15 @@ class Projects::DeploymentsController < Projects::ApplicationController end def metrics + return render_404 unless deployment.has_metrics? @metrics = deployment.metrics - if @metrics&.any? render json: @metrics, status: :ok else head :no_content end + rescue NotImplementedError + render_404 end private |