Skip to content

Commit b4908d4

Browse files
Exception messages should not expose infrastructure information (#7007)
1 parent ea18af8 commit b4908d4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/NuGetGallery.Core/Entities/DatabaseWrapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public async Task<int> ExecuteSqlResourceAsync(string name, params object[] para
4646

4747
if (string.IsNullOrEmpty(sqlCommand))
4848
{
49-
throw new ArgumentException($"SQL resource '{name}' is empty.", "name");
49+
throw new ArgumentException($"SQL resource '{name}' is empty.", nameof(name));
5050
}
5151

5252
return await ExecuteSqlCommandAsync(sqlCommand, parameters);

src/NuGetGallery/Configuration/SmtpUri.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public SmtpUri(Uri uri)
2424
Secure = uri.Scheme.Equals("smtps", StringComparison.OrdinalIgnoreCase);
2525
if (!Secure && !uri.Scheme.Equals("smtp", StringComparison.OrdinalIgnoreCase))
2626
{
27-
throw new FormatException("Invalid SMTP URL: " + uri.ToString());
27+
throw new FormatException("Invalid SMTP URL");
2828
}
2929

3030
var m = UserInfoParser.Match(uri.UserInfo);

0 commit comments

Comments
 (0)