Skip to content

Commit

Permalink
Merge pull request #245 from meysamhadeli/fix/fix-problem-details-type
Browse files Browse the repository at this point in the history
fix: Fix problem details type
  • Loading branch information
meysamhadeli authored Apr 3, 2023
2 parents 89f9033 + 050c9d2 commit e095cfb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit e095cfb

Please sign in to comment.