RevolutionPrep/netsuite — pull request #45 by brunobuccolo (2014-01-17 21:06:35+00:00)
Title: Adds the ability to check for the error on records after a failing operation.

**Disclaimer:** Needs some testing. Can be extended to cover all other operations. (wip)

It's currently hard to find out what happened when an operations fails:
```ruby
invoice = NetSuite::Records::Invoice.new({
created_from: {
internal_id: ""
}
})

invoice.add # returns false. But what happened?
```

The idea is to provide an error method to check for the error status:
```ruby
invoice.error.code # "INVALID_INITIALIZE_REF"
invoice.error.message # "You can not initialize invoice: invalid reference 7281."
```

Next week I'll have more time to work on this.

Great gem, thanks! :beers: