From 050c9d2b24133ab951cbc70a788d590463893b00 Mon Sep 17 00:00:00 2001 From: Pc Date: Mon, 3 Apr 2023 19:12:42 +0330 Subject: [PATCH] fix: Fix problem details type --- .../Infrastructure/ProblemDetailsExtensions.cs | 16 ++++++++-------- .../Infrastructure/ProblemDetailsExtensions.cs | 16 ++++++++-------- .../Infrastructure/ProblemDetailsExtensions.cs | 16 ++++++++-------- .../Infrastructure/ProblemDetailsExtensions.cs | 16 ++++++++-------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/Services/Booking/src/Booking/Extensions/Infrastructure/ProblemDetailsExtensions.cs b/src/Services/Booking/src/Booking/Extensions/Infrastructure/ProblemDetailsExtensions.cs index 32c2ffb6..4599c615 100644 --- a/src/Services/Booking/src/Booking/Extensions/Infrastructure/ProblemDetailsExtensions.cs +++ b/src/Services/Booking/src/Booking/Extensions/Infrastructure/ProblemDetailsExtensions.cs @@ -30,56 +30,56 @@ public static WebApplication UseCustomProblemDetails(this WebApplication app) ConflictException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.8", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status409Conflict ), ValidationException validationException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = (int)validationException.StatusCode ), BadRequestException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status400BadRequest ), NotFoundException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.4", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status404NotFound ), AppException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status400BadRequest ), DbUpdateConcurrencyException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.8", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status409Conflict ), RpcException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status400BadRequest ), _ => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.6.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status500InternalServerError ) diff --git a/src/Services/Flight/src/Flight/Extensions/Infrastructure/ProblemDetailsExtensions.cs b/src/Services/Flight/src/Flight/Extensions/Infrastructure/ProblemDetailsExtensions.cs index a6a070dd..95ef53c2 100644 --- a/src/Services/Flight/src/Flight/Extensions/Infrastructure/ProblemDetailsExtensions.cs +++ b/src/Services/Flight/src/Flight/Extensions/Infrastructure/ProblemDetailsExtensions.cs @@ -31,56 +31,56 @@ public static WebApplication UseCustomProblemDetails(this WebApplication app) ConflictException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.8", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status409Conflict ), ValidationException validationException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = (int)validationException.StatusCode ), BadRequestException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status400BadRequest ), NotFoundException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.4", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status404NotFound ), AppException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status400BadRequest ), DbUpdateConcurrencyException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.8", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status409Conflict ), RpcException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status400BadRequest ), _ => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.6.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status500InternalServerError ) diff --git a/src/Services/Identity/src/Identity/Extensions/Infrastructure/ProblemDetailsExtensions.cs b/src/Services/Identity/src/Identity/Extensions/Infrastructure/ProblemDetailsExtensions.cs index c75dc07c..3a9cd0ac 100644 --- a/src/Services/Identity/src/Identity/Extensions/Infrastructure/ProblemDetailsExtensions.cs +++ b/src/Services/Identity/src/Identity/Extensions/Infrastructure/ProblemDetailsExtensions.cs @@ -30,56 +30,56 @@ public static WebApplication UseCustomProblemDetails(this WebApplication app) ConflictException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.8", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status409Conflict ), ValidationException validationException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = (int)validationException.StatusCode ), BadRequestException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status400BadRequest ), NotFoundException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.4", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status404NotFound ), AppException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status400BadRequest ), DbUpdateConcurrencyException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.8", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status409Conflict ), RpcException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status400BadRequest ), _ => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.6.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status500InternalServerError ) diff --git a/src/Services/Passenger/src/Passenger/Extensions/Infrastructure/ProblemDetailsExtensions.cs b/src/Services/Passenger/src/Passenger/Extensions/Infrastructure/ProblemDetailsExtensions.cs index dcad2067..946c892d 100644 --- a/src/Services/Passenger/src/Passenger/Extensions/Infrastructure/ProblemDetailsExtensions.cs +++ b/src/Services/Passenger/src/Passenger/Extensions/Infrastructure/ProblemDetailsExtensions.cs @@ -30,56 +30,56 @@ public static WebApplication UseCustomProblemDetails(this WebApplication app) ConflictException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.8", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status409Conflict ), ValidationException validationException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = (int)validationException.StatusCode ), BadRequestException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status400BadRequest ), NotFoundException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.4", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status404NotFound ), AppException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status400BadRequest ), DbUpdateConcurrencyException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.8", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status409Conflict ), RpcException => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status400BadRequest ), _ => ( exceptionType.Message, - exceptionType.GetType().ToString(), + "https://www.rfc-editor.org/rfc/rfc7231#section-6.6.1", exceptionType.GetType().Name, context.Response.StatusCode = StatusCodes.Status500InternalServerError )