Azure / autorest.powershell

AutoRest PowerShell Generator
MIT License
112 stars 78 forks source link

[ExceptionHandling] exception message throwed by ViaIdentity doesn't match the parttern #1152

Closed BethanyZhou closed 1 year ago

BethanyZhou commented 1 year ago

Current behavior:

  var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?<subscriptionId>[^/]+)/resourceGroups/(?<resourceGroupName>[^/]+)/providers/Microsoft.DBforMySQL/servers/(?<serverName>[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
                if (!_match.Success)
                {
                    throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/restart'");
                }

Expected behavior:

                throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}'");
dolauli commented 1 year ago

Fixed in v4