From 1db5efc8bcb871ef92b5655aac5f1a1fe91ccd1c Mon Sep 17 00:00:00 2001 From: Jay Wang Date: Thu, 30 Mar 2017 15:35:29 -0700 Subject: [PATCH] Better error message for LNG import error. --- .../azurerm/resource_arm_local_network_gateway.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builtin/providers/azurerm/resource_arm_local_network_gateway.go b/builtin/providers/azurerm/resource_arm_local_network_gateway.go index 6038e47c3..8d23a2ae7 100644 --- a/builtin/providers/azurerm/resource_arm_local_network_gateway.go +++ b/builtin/providers/azurerm/resource_arm_local_network_gateway.go @@ -102,7 +102,12 @@ func resourceArmLocalNetworkGatewayRead(d *schema.ResourceData, meta interface{} } name := id.Path["localNetworkGateways"] 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