Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit d81d365

Browse files
committed
Use string interpolation for error messages.
1 parent 18de75e commit d81d365

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Microsoft.AspNet.Http/Authentication/DefaultAuthenticationManager.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public override AuthenticationResult Authenticate([NotNull] string authenticatio
5858

5959
if (!authenticateContext.Accepted)
6060
{
61-
throw new InvalidOperationException("The following authentication scheme was not accepted: " + authenticationScheme);
61+
throw new InvalidOperationException($"The following authentication scheme was not accepted: {authenticationScheme}");
6262
}
6363

6464
return new AuthenticationResult(authenticateContext.Principal,
@@ -79,7 +79,7 @@ public override async Task<AuthenticationResult> AuthenticateAsync([NotNull] str
7979
// Verify all types ack'd
8080
if (!authenticateContext.Accepted)
8181
{
82-
throw new InvalidOperationException("The following authentication scheme was not accepted: " + authenticationScheme);
82+
throw new InvalidOperationException($"The following authentication scheme was not accepted: {authenticationScheme}");
8383
}
8484

8585
return new AuthenticationResult(authenticateContext.Principal,
@@ -101,7 +101,7 @@ public override void Challenge(AuthenticationProperties properties, string authe
101101
// The default Challenge with no scheme is always accepted
102102
if (!challengeContext.Accepted && !string.IsNullOrEmpty(authenticationScheme))
103103
{
104-
throw new InvalidOperationException("The following authentication type was not accepted: " + authenticationScheme);
104+
throw new InvalidOperationException($"The following authentication scheme was not accepted: {authenticationScheme}");
105105
}
106106
}
107107

@@ -118,7 +118,7 @@ public override void SignIn([NotNull] string authenticationScheme, [NotNull] Cla
118118
// Verify all types ack'd
119119
if (!signInContext.Accepted)
120120
{
121-
throw new InvalidOperationException("The following authentication scheme was not accepted: " + authenticationScheme);
121+
throw new InvalidOperationException($"The following authentication scheme was not accepted: {authenticationScheme}");
122122
}
123123
}
124124

@@ -135,7 +135,7 @@ public override void SignOut(string authenticationScheme, AuthenticationProperti
135135
// Verify all types ack'd
136136
if (!string.IsNullOrWhiteSpace(authenticationScheme) && !signOutContext.Accepted)
137137
{
138-
throw new InvalidOperationException("The following authentication scheme was not accepted: " + authenticationScheme);
138+
throw new InvalidOperationException($"The following authentication scheme was not accepted: {authenticationScheme}");
139139
}
140140
}
141141

0 commit comments

Comments
 (0)