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