diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2015-12-28 16:38:02 +0100 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2015-12-28 16:38:02 +0100 |
commit | e7d0746d9319119c459581615ae4205139bee444 (patch) | |
tree | 4f19de5e7c351be303d847abfa1dfed65cd02bba /lib | |
parent | d398e78ea09c1f88800cd4c99f92dd8e5d1d0d39 (diff) | |
download | gitlab-ce-e7d0746d9319119c459581615ae4205139bee444.tar.gz |
Add 'not_found' notifications in build/trace details
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/builds.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/api/builds.rb b/lib/api/builds.rb index 7488863cdcf..5ac24d0367a 100644 --- a/lib/api/builds.rb +++ b/lib/api/builds.rb @@ -19,7 +19,7 @@ module API present paginate(builds), with: Entities::Build end - # GET builds for a specific commit of a project + # Get builds for a specific commit of a project # # Parameters: # id (required) - The ID of a project @@ -40,7 +40,10 @@ module API # Example Request: # GET /projects/:id/builds/:build_id get ':id/builds/:build_id' do - present get_build(params[:build_id]), with: Entities::Build + build = get_build(params[:build_id]) + return not_found!(build) unless build + + present build, with: Entities::Build end # Get a trace of a specific build of a project @@ -52,6 +55,7 @@ module API # GET /projects/:id/build/:build_id/trace get ':id/builds/:build_id/trace' do build = get_build(params[:build_id]) + return not_found!(build) unless build header 'Content-Disposition', "infile; filename=\"#{build.id}.log\"" content_type 'text/plain' |