1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Throw errors instead of printing them.

This commit is contained in:
Nat Welch 2013-06-27 00:27:38 -07:00
parent 0d83fa2ab8
commit 23d4c7c95e

View file

@ -75,6 +75,7 @@ module Fog
@project = options[:google_project]
google_client_email = options[:google_client_email]
@api_url = base_url + api_version + '/projects/'
# NOTE: loaded here to avoid requiring this as a core Fog dependency
begin
require 'google/api_client'
@ -125,8 +126,7 @@ module Fog
response.status = response.body["error"]["code"]
response.body["error"]["errors"].each do |error|
# We could throw these I guess.
p Fog::Errors::Error.new(error["message"])
throw Fog::Errors::Error.new(error["message"])
end
else
response.status = 200