Sha256: 680da25b827c177148a1b21a7befcd585da35377b71cd1e877c3df636c6cd65f
Contents?: true
Size: 1.09 KB
Versions: 4
Compression:
Stored size: 1.09 KB
Contents
# frozen_string_literal: true module Proscenium class Middleware class Esbuild < Base class CompileError < Base::CompileError def initialize(args) detail = args[:detail] detail = ActiveSupport::HashWithIndifferentAccess.new(Oj.load(detail, mode: :strict)) args[:detail] = if detail[:location] "#{detail[:text]} in #{detail[:location][:file]}:" + detail[:location][:line].to_s else detail[:text] end super args end end def attempt ActiveSupport::Notifications.instrument('build.proscenium', identifier: path_to_build) do render_response Proscenium::Builder.build(path_to_build, root: root, base_url: @request.base_url) end rescue Proscenium::Builder::CompileError => e raise self.class::CompileError, { file: @request.fullpath, detail: e.message }, caller end end end end
Version data entries
4 entries across 4 versions & 1 rubygems