Exception: Teemill::DocumentedError

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

Direct Known Subclasses

MissingCredentialsError

Instance Method Summary collapse

Constructor Details

#initializeDocumentedError

Returns a new instance of DocumentedError.


5
6
7
8
9
# File 'lib/errors/documented_error.rb', line 5

def initialize
  STDERR.puts message.red
  STDERR.puts "See: #{docs_reference}".yellow
  super(message)
end

Instance Method Details

#docs_domainObject


19
20
21
# File 'lib/errors/documented_error.rb', line 19

def docs_domain
  "https://teemill.com"
end

#docs_hash_markObject


31
32
33
# File 'lib/errors/documented_error.rb', line 31

def docs_hash_mark
  "#"
end

#docs_pathObject


23
24
25
# File 'lib/errors/documented_error.rb', line 23

def docs_path
  "/api-docs"
end

#docs_query_paramsObject


27
28
29
# File 'lib/errors/documented_error.rb', line 27

def docs_query_params
  "?lang=ruby"
end

#docs_referenceObject


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

def docs_reference
  "#{docs_domain}#{docs_path}#{docs_query_params}#{docs_hash_mark}"
end

#messageObject


11
12
13
# File 'lib/errors/documented_error.rb', line 11

def message
  "Unknown error occurred"
end