Exception: NSConnector::Errors::NSError
- Inherits:
-
Exception
- Object
- Exception
- NSConnector::Errors::NSError
- Defined in:
- lib/ns_connector/errors.rb
Overview
Parent class to encapsulate all successfully parsed JSON netsuite error responses.
Instance Method Summary collapse
-
#code ⇒ Object
Returns the error code from the JSON returned by netsuite.
-
#initialize(netsuite_error = nil) ⇒ NSError
constructor
A new instance of NSError.
-
#message ⇒ Object
Takes the error message straight out of the netsuite response.
Constructor Details
#initialize(netsuite_error = nil) ⇒ NSError
Returns a new instance of NSError.
9 10 11 |
# File 'lib/ns_connector/errors.rb', line 9 def initialize netsuite_error=nil @netsuite_error = netsuite_error if netsuite_error end |
Instance Method Details
#code ⇒ Object
Returns the error code from the JSON returned by netsuite. Something like: “RCRD_DSNT_EXIST”
15 16 17 |
# File 'lib/ns_connector/errors.rb', line 15 def code @netsuite_error['code'] rescue nil end |
#message ⇒ Object
Takes the error message straight out of the netsuite response. Usually makes some sense.
21 22 23 |
# File 'lib/ns_connector/errors.rb', line 21 def @netsuite_error['message'] rescue nil end |