Exception: TsJsonApi::Exception

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/ts_json_api/exceptions.rb

Overview

This is the base exception class, rescue this to catch any exceptions that this gem will throw

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Exception

Returns a new instance of Exception.



8
9
10
11
12
# File 'lib/ts_json_api/exceptions.rb', line 8

def initialize(*args)
	options = args.extract_options!
	self.rest_client_exception = options[:exception]
	self.http_code = options[:http_code] || 0
end

Instance Attribute Details

#http_codeObject

Returns the value of attribute http_code.



6
7
8
# File 'lib/ts_json_api/exceptions.rb', line 6

def http_code
  @http_code
end

#messageObject

Returns the value of attribute message.



6
7
8
# File 'lib/ts_json_api/exceptions.rb', line 6

def message
  @message
end

#rest_client_exceptionObject

Returns the value of attribute rest_client_exception.



6
7
8
# File 'lib/ts_json_api/exceptions.rb', line 6

def rest_client_exception
  @rest_client_exception
end

Instance Method Details

#to_sObject



18
19
20
# File 'lib/ts_json_api/exceptions.rb', line 18

def to_s
	message
end