Merge branch '17967-storage-classes-config' into main
[arvados.git] / apps / workbench / app / helpers / pipeline_components_helper.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 module PipelineComponentsHelper
6   def render_pipeline_components(template_suffix, fallback=nil, locals={})
7     begin
8       render(partial: "pipeline_instances/show_components_#{template_suffix}",
9              locals: locals)
10     rescue => e
11       logger.error "#{e.inspect}"
12       logger.error "#{e.backtrace.join("\n\t")}"
13       case fallback
14       when :json
15         render(partial: "pipeline_instances/show_components_json",
16                locals: {error_name: e.inspect, backtrace: e.backtrace.join("\n\t")})
17       end
18     end
19   end
20 end