Better error message for LNG import error.

This commit is contained in:
Jay Wang 2017-03-30 15:35:29 -07:00
parent 630f371b0c
commit 1db5efc8bc
1 changed files with 6 additions and 1 deletions

View File

@ -102,7 +102,12 @@ func resourceArmLocalNetworkGatewayRead(d *schema.ResourceData, meta interface{}
} }
name := id.Path["localNetworkGateways"] name := id.Path["localNetworkGateways"]
if name == "" { if name == "" {
return fmt.Errorf("Cannot find parameter 'localNetworkGateways' from '%s'", id.Path) var pathString, sp string
for key, value := range id.Path {
pathString += fmt.Sprintf("%s'%s:%s'", sp, key, value)
sp = ", "
}
return fmt.Errorf("Cannot find 'localNetworkGateways' in [%s], make sure it is specified in the ID parameter", pathString)
} }
resGroup := id.ResourceGroup resGroup := id.ResourceGroup