Exception: Proscenium::Middleware::Esbuild::CompileError

Inherits:
Base::CompileError show all
Defined in:
lib/proscenium/middleware/esbuild.rb

Instance Attribute Summary

Attributes inherited from Base::CompileError

#detail, #file

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ CompileError

Returns a new instance of CompileError.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/proscenium/middleware/esbuild.rb', line 7

def initialize(args)
  detail = args[:detail]
  detail = JSON.parse(detail, mode: :strict)

  args['detail'] = if detail['location']
                     "#{detail['text']} in #{detail['location']['file']}:" +
                       detail['location']['line'].to_s
                   else
                     detail['text']
                   end

  super
end