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:
parent
0d83fa2ab8
commit
23d4c7c95e
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue