Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Commit

Permalink
catch for the uncatchable UNEXPECTED_ERROR from Netsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesChristie committed Aug 18, 2012
1 parent 85cf33d commit 4d32e8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/netsuite-rest-client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ def parse_json_result_from_rest(method, params, options={})
raise "Unable to parse reply from Netsuite: #{reply}"
end

if parsed.first
parsed.last[0]
else
if !parsed.first || parsed.flatten.include?("UNEXPECTED_ERROR")
raise "Error processing request: #{parsed.last[0].to_s}"
else
parsed.last[0]
end
end

Expand Down

0 comments on commit 4d32e8b

Please sign in to comment.