diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/HttpExceptionMiddleware.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/HttpExceptionMiddleware.cs index de3b864314c..f39023cd0f0 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/HttpExceptionMiddleware.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/HttpExceptionMiddleware.cs @@ -56,11 +56,11 @@ public async Task Invoke(HttpContext context) response.Headers.Append("x-request-known-exception", "true"); response.Headers.Append("x-request-known-exception-error", encodedException); } - + var bodyObj = new { Message = e.Message, - Status = e.StatusCode + Status = e.StatusCode.ToString() }; DebugLogger.LogError(e.Message); @@ -85,7 +85,7 @@ public async Task Invoke(HttpContext context) var bodyObj = new { Message = e.Message, - Status = unexpectedStatusCode, + Status = unexpectedStatusCode.ToString(), StackTrace = e.StackTrace, }; diff --git a/tools/test-proxy/typespec/main.tsp b/tools/test-proxy/typespec/main.tsp index a99ce07abd7..672a57c006c 100644 --- a/tools/test-proxy/typespec/main.tsp +++ b/tools/test-proxy/typespec/main.tsp @@ -16,7 +16,7 @@ model StartPayload { model CommonErrorResponse { Message: string; - Status: int32; + Status: string; StackTrace?: string; @header("x-request-exception") requestException: boolean; @header("x-request-exception-error") requestExceptionError: string;