Exception: Esbuild::BuildFailureError
- Inherits:
-
StandardError
- Object
- StandardError
- Esbuild::BuildFailureError
- Defined in:
- lib/esbuild/service.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
-
#initialize(errors, warnings) ⇒ BuildFailureError
constructor
A new instance of BuildFailureError.
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
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
265 266 267 |
# File 'lib/esbuild/service.rb', line 265 def errors @errors end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
266 267 268 |
# File 'lib/esbuild/service.rb', line 266 def warnings @warnings end |