GoogleCloudPlatform / google-cloud-powershell

PowerShell cmdlets for the Google Cloud Platform
http://googlecloudplatform.github.io/google-cloud-powershell/
Apache License 2.0
135 stars 61 forks source link

Make add-gceinstance and add-gcemanagedinstancegroup throws non-terminating error #588

Closed quoctruong closed 6 years ago

quoctruong commented 6 years ago

This is to fix https://github.com/GoogleCloudPlatform/google-cloud-powershell/issues/586.


This change is Reviewable

iantalarico commented 6 years ago

I'm a little confused here (probably due to my lack of PS knowledge). Why are we only catching conflicts here? What is the expected result of 'SilentlyContinue'? Does this mean any failure results in non termination?

quoctruong commented 6 years ago

@iantalarico There are 2 types of errors here: terminating and non-terminating error. 'SilentlyContinue' can only suppress non-terminating error. For some cmdlets, I think it makes sense in some common scenarios to write a non-terminating error (like the instance that we are trying to create already exists) instead of throwing the terminating error. This way, the user can suppress it.

quoctruong commented 6 years ago

Thanks! Fixed the tests.