Exception: Esbuild::BuildFailureError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/esbuild/service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors, warnings) ⇒ BuildFailureError

Returns a new instance of BuildFailureError.



268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/esbuild/service.rb', line 268

def initialize(errors, warnings)
  @errors = errors
  @warnings = warnings
  summary = ""
  unless errors.empty?
    limit = 5
    details = errors.slice(0, limit + 1).each_with_index.map do |error, index|
      transform_error(error, index, limit)
    end.join
    summary = " with #{errors.size} error#{errors.size > 1 ? "s" : ""}:#{details}"
  end

  super "Build failed#{summary}"
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



265
266
267
# File 'lib/esbuild/service.rb', line 265

def errors
  @errors
end

#warningsObject (readonly)

Returns the value of attribute warnings.



266
267
268
# File 'lib/esbuild/service.rb', line 266

def warnings
  @warnings
end