Exception: Ryac::Pipeline::FileNotFoundError

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

Overview

Raised when a required file cannot be found

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, required_from: nil, line: nil) ⇒ FileNotFoundError

Returns a new instance of FileNotFoundError.

Parameters:

  • path (String)
  • required_from: (String, nil) (defaults to: nil)
  • line: (Integer, nil) (defaults to: nil)


17
18
19
20
21
22
23
24
25
# File 'lib/ryac/pipeline/errors.rb', line 17

def initialize(path, required_from: nil, line: nil)
  @path = path
  @required_from = required_from
  @line = line

  message = "File not found: #{path}"
  message += " (required from #{required_from}:#{line})" if required_from && line
  super(message)
end

Instance Attribute Details

#line ⇒ Integer? (readonly)

Returns the value of attribute line.

Returns:

  • (Integer, nil)


15
16
17
# File 'lib/ryac/pipeline/errors.rb', line 15

def line
  @line
end

#path ⇒ String (readonly)

Returns the value of attribute path.

Returns:

  • (String)


15
16
17
# File 'lib/ryac/pipeline/errors.rb', line 15

def path
  @path
end

#required_from ⇒ String? (readonly)

Returns the value of attribute required_from.

Returns:

  • (String, nil)


15
16
17
# File 'lib/ryac/pipeline/errors.rb', line 15

def required_from
  @required_from
end