Merge pull request #245 from meysamhadeli/fix/fix-problem-details-type

fix: Fix problem details type
This commit is contained in:
Meysam Hadeli 2023-04-03 21:40:18 +03:30 committed by GitHub
commit e095cfb9fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 32 deletions

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)

View File

@ -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
)