Method: Tango::Error.from_status_code

Defined in:
lib/tango/error.rb

.from_status_code(status_code) ⇒ Tango::Error

Creates a new Error object from status_code

Parameters:

  • status_code (Integer)

    HTTP response status code

Returns:



9
10
11
12
13
# File 'lib/tango/error.rb', line 9

def self.from_status_code(status_code)
  ex = new("Error: #{status_code}")
  ex.status_code = status_code
  ex
end