mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-13 20:18:36 +08:00
Merge pull request #245 from meysamhadeli/fix/fix-problem-details-type
fix: Fix problem details type
This commit is contained in:
commit
e095cfb9fc
@ -30,56 +30,56 @@ public static class ProblemDetailsExtensions
|
||||
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
|
||||
)
|
||||
|
||||
@ -31,56 +31,56 @@ public static class ProblemDetailsExtensions
|
||||
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
|
||||
)
|
||||
|
||||
@ -30,56 +30,56 @@ public static class ProblemDetailsExtensions
|
||||
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
|
||||
)
|
||||
|
||||
@ -30,56 +30,56 @@ public static class ProblemDetailsExtensions
|
||||
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
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user