lib/magellan/cli/base.rb in magellan-cli-0.7.5 vs lib/magellan/cli/base.rb in magellan-cli-0.7.6
- old
+ new
@@ -149,9 +149,15 @@
http_access do |api|
api.delete(rel_path, &block)
end
end
+ def process_error_response(res)
+ obj = JSON.parse(res.body) rescue nil
+ if obj and obj.is_a?(Hash) and msg = obj["message"]
+ fatal(msg)
+ end
+ end
end
class << self