Handle error on trace raw download with old builds (DB stored)
This commit is contained in:
		
							parent
							
								
									313b09fcbb
								
							
						
					
					
						commit
						ed51734030
					
				|  | @ -78,7 +78,7 @@ class Projects::BuildsController < Projects::ApplicationController | |||
|   end | ||||
| 
 | ||||
|   def raw | ||||
|     if @build.has_trace? | ||||
|     if @build.has_trace_file? | ||||
|       send_file @build.path_to_trace, type: 'text/plain; charset=utf-8', disposition: 'inline' | ||||
|     else | ||||
|       render_404 | ||||
|  |  | |||
|  | @ -208,6 +208,10 @@ module Ci | |||
|       end | ||||
|     end | ||||
| 
 | ||||
|     def has_trace_file? | ||||
|       File.exist?(path_to_trace) || (project.ci_id && File.exist?(old_path_to_trace)) | ||||
|     end | ||||
| 
 | ||||
|     def has_trace? | ||||
|       raw_trace.present? | ||||
|     end | ||||
|  |  | |||
|  | @ -100,7 +100,7 @@ | |||
|         - elsif @build.runner | ||||
|           \##{@build.runner.id} | ||||
|       .btn-group.btn-group-justified{ role: :group } | ||||
|         - if @build.has_trace? | ||||
|         - if @build.has_trace_file? | ||||
|           = link_to 'Raw', raw_namespace_project_build_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default' | ||||
|         - if @build.active? | ||||
|           = link_to "Cancel", cancel_namespace_project_build_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default', method: :post | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue