Sha256: a5c1bf4ec51bf53e001b69d8a505bea86d71bf6f785c8e48fe4e2098313db05c
Contents?: true
Size: 993 Bytes
Versions: 16
Compression:
Stored size: 993 Bytes
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 render_response Builder.build_to_string(path_to_build, root: Rails.root.to_s, base_url: @request.base_url) rescue Builder::CompileError => e raise self.class::CompileError, { file: @request.fullpath, detail: e.message }, caller end end end end
Version data entries
16 entries across 16 versions & 1 rubygems