diff options
author | Tiger <twatson@gitlab.com> | 2019-03-27 07:01:35 +0300 |
---|---|---|
committer | Tiger <twatson@gitlab.com> | 2019-04-02 03:07:06 +0300 |
commit | 02b9b5facf0496f7c64a7913cc4f4c8437527f72 (patch) | |
tree | fa77235e436e22112839c252d877516358d8b60f /app/serializers | |
parent | de03a8bcb45f11a50bee071e977274c113e7b39a (diff) |
Expose build failure reason
We can use this to show more informative error messages with
links to documentation etc.
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/build_details_entity.rb | 2 |
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 |