modules/mu/providers/google/folder.rb in cloud-mu-3.4.0 vs modules/mu/providers/google/folder.rb in cloud-mu-3.5.0
- old
+ new
@@ -263,11 +263,15 @@
my_org.name
end
if args[:cloud_id]
raw_id = args[:cloud_id].sub(/^folders\//, "")
- resp = MU::Cloud::Google.folder(credentials: args[:credentials]).get_folder("folders/"+raw_id)
- found[resp.name] = resp if resp
+ begin
+ resp = MU::Cloud::Google.folder(credentials: args[:credentials]).get_folder("folders/"+raw_id)
+ found[resp.name] = resp if resp
+ rescue ::Google::Apis::ClientError => e
+ raise e if e.message !~ /forbidden: /
+ end
elsif args[:flags] and args[:flags]['display_name']
if parent
resp = self.find_matching_folder(parent, name: args[:flags]['display_name'], credentials: args[:credentials])