Exception: Ryac::Pipeline::InvalidOutputError

Inherits:
InternalError show all
Defined in:
lib/ryac/pipeline/errors.rb,
sig/ryac/pipeline/errors.rbs

Overview

Raised when the pipeline produced output that does not parse. The broken output is a bug in a stage, and failing here names the producer instead of letting the consumer discover it at load time.

Instance Method Summary collapse

Constructor Details

#initialize(label, errors) ⇒ InvalidOutputError

Returns a new instance of InvalidOutputError.

Parameters:

  • label (String)
  • errors (Array[Prism::ParseError])


74
75
76
77
78
79
# File 'lib/ryac/pipeline/errors.rb', line 74

def initialize(label, errors)
  detail = errors.first(3).map { |e|
    "#{e.location.start_line}:#{e.location.start_column}: #{e.message}"
  }.join("; ")
  super("minified #{label} does not parse (#{detail})")
end