From 5bc8c6517a1f0706e40b5e43fd89fe49eabe0366 Mon Sep 17 00:00:00 2001 From: Scott Beddall <45376673+scbedd@users.noreply.github.com> Date: Fri, 22 Sep 2023 15:19:43 -0700 Subject: [PATCH] Update Error for Sanitizer Add (#7005) * create cherry-pickable commit * update tests to reflect new logged outputs --- .../test-proxy/Azure.Sdk.Tools.TestProxy.Tests/AdminTests.cs | 2 +- tools/test-proxy/Azure.Sdk.Tools.TestProxy/Admin.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/AdminTests.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/AdminTests.cs index 843c590daef..44f2467c073 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/AdminTests.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/AdminTests.cs @@ -882,7 +882,7 @@ public async Task TestAddSanitizerThrowsOnMissingRequiredArgument() ); Assert.True(assertion.StatusCode.Equals(HttpStatusCode.BadRequest)); - Assert.Contains("Required parameter key System.String target was not found in the request body.", assertion.Message); + Assert.Contains("Required parameter key \"target\" was not found in the request body.", assertion.Message); } [Fact] diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Admin.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Admin.cs index f8d2f1ec7d3..f12f45d3c18 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Admin.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Admin.cs @@ -215,7 +215,7 @@ private object GenerateInstance(string typePrefix, string name, HashSet { if (!acceptableEmptyArgs.Contains(param.Name)) { - throw new HttpException(HttpStatusCode.BadRequest, $"Parameter {param.Name} was passed with no value. Please check the request body and try again."); + throw new HttpException(HttpStatusCode.BadRequest, $"Parameter \"{param.Name}\" was passed with no value. Please check the request body and try again."); } } @@ -229,7 +229,7 @@ private object GenerateInstance(string typePrefix, string name, HashSet } else { - throw new HttpException(HttpStatusCode.BadRequest, $"Required parameter key {param} was not found in the request body."); + throw new HttpException(HttpStatusCode.BadRequest, $"Required parameter key \"{param.Name}\" was not found in the request body."); } } }