Exception: Roadie::InvalidUrlPath

Inherits:
Error
  • Object
show all
Defined in:
lib/roadie/errors.rb

Overview

Raised when Roadie encounters an invalid URL which cannot be parsed by Ruby’s URI class.

This could be a hint that something in your HTML or CSS is broken.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(given_path, cause = nil) ⇒ InvalidUrlPath

Returns a new instance of InvalidUrlPath.



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/roadie/errors.rb', line 19

def initialize(given_path, cause = nil)
  @cause = cause
  cause_message = if cause
    " Caused by: #{cause}"
  else
    ""
  end
  super(
    "Cannot use path \"#{given_path}\" in URL generation.#{cause_message}"
  )
end

Instance Attribute Details

#causeObject (readonly)

The original error, raised from URI.



17
18
19
# File 'lib/roadie/errors.rb', line 17

def cause
  @cause
end