Exception: IndieAuthDiscovery::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/indieauth_discovery/errors.rb

Overview

Base class for IndieAuthDiscovery errors.

Direct Known Subclasses

DiscoveryError, InvalidURLError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error, error_reason = nil, error_uri = nil) ⇒ Error

Returns a new instance of Error.



8
9
10
11
12
13
14
# File 'lib/indieauth_discovery/errors.rb', line 8

def initialize(error, error_reason = nil, error_uri = nil)
  @error = error
  @error_reason = error_reason
  @error_uri = error_uri

  super(message)
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



6
7
8
# File 'lib/indieauth_discovery/errors.rb', line 6

def error
  @error
end

#error_reasonObject

Returns the value of attribute error_reason.



6
7
8
# File 'lib/indieauth_discovery/errors.rb', line 6

def error_reason
  @error_reason
end

#error_uriObject

Returns the value of attribute error_uri.



6
7
8
# File 'lib/indieauth_discovery/errors.rb', line 6

def error_uri
  @error_uri
end

Instance Method Details

#messageObject



16
17
18
# File 'lib/indieauth_discovery/errors.rb', line 16

def message
  [error, error_reason, error_uri].compact.join(' | ')
end