summaryrefslogtreecommitdiff
path: root/app/serializers/build_details_entity.rb
diff options
context:
space:
mode:
authorTiger <twatson@gitlab.com>2019-03-27 15:01:35 +1100
committerTiger <twatson@gitlab.com>2019-04-02 11:07:06 +1100
commit02b9b5facf0496f7c64a7913cc4f4c8437527f72 (patch)
treefa77235e436e22112839c252d877516358d8b60f /app/serializers/build_details_entity.rb
parentde03a8bcb45f11a50bee071e977274c113e7b39a (diff)
downloadgitlab-ce-02b9b5facf0496f7c64a7913cc4f4c8437527f72.tar.gz
Expose build failure reason
We can use this to show more informative error messages with links to documentation etc.
Diffstat (limited to 'app/serializers/build_details_entity.rb')
-rw-r--r--app/serializers/build_details_entity.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/serializers/build_details_entity.rb b/app/serializers/build_details_entity.rb
index 9ddce0d2c80..62c26809eeb 100644
--- a/app/serializers/build_details_entity.rb
+++ b/app/serializers/build_details_entity.rb
@@ -45,6 +45,8 @@ class BuildDetailsEntity < JobEntity
erase_project_job_path(project, build)
end
+ expose :failure_reason, if: -> (*) { build.failed? }
+
expose :terminal_path, if: -> (*) { can_create_build_terminal? } do |build|
terminal_project_job_path(project, build)
end