Exception: Yay::InstallFailedError
- Defined in:
- lib/yay/errors.rb
Overview
this error wraps an underlying error
Constant Summary collapse
- MAX_LENGTH =
1028
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(url, error, content = nil) ⇒ InstallFailedError
constructor
A new instance of InstallFailedError.
- #printable_message ⇒ Object
Methods inherited from Error
Constructor Details
#initialize(url, error, content = nil) ⇒ InstallFailedError
Returns a new instance of InstallFailedError.
46 47 48 49 50 51 52 53 54 |
# File 'lib/yay/errors.rb', line 46 def initialize url, error, content=nil @url = url @error = error @content = content @content = 'empty' if (content==nil||content.strip=="") if @content.length >= InstallFailedError::MAX_LENGTH @content = "#{@content.slice(0,InstallFailedError::MAX_LENGTH)}\n.." end end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
44 45 46 |
# File 'lib/yay/errors.rb', line 44 def content @content end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
42 43 44 |
# File 'lib/yay/errors.rb', line 42 def error @error end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
43 44 45 |
# File 'lib/yay/errors.rb', line 43 def url @url end |
Instance Method Details
#printable_message ⇒ Object
56 57 58 |
# File 'lib/yay/errors.rb', line 56 def return "Failed to download and install file from #{url}\nReason: #{error}\nResponse was:\n#{content}\nCheck your url!" end |