Skip to content

Add InternalServerError when err is not nil in strict-gin#1012

Merged
deepmap-marcinr merged 1 commit intooapi-codegen:masterfrom
shirou:feature/add_internalservererror_on_gin_strict_handler
May 5, 2023
Merged

Add InternalServerError when err is not nil in strict-gin#1012
deepmap-marcinr merged 1 commit intooapi-codegen:masterfrom
shirou:feature/add_internalservererror_on_gin_strict_handler

Conversation

@shirou
Copy link
Copy Markdown
Contributor

@shirou shirou commented Mar 25, 2023

When a strict server is created with gin, if it returns a non-nil error, ctx.Error will log that error, but it will return HTTP Status 200.
Looking at other implementations of echo and http, it seems that the intention is to return a 500 InternalServerError.

In this PR, I would add that HTTP Status should be set to 500 for strict servers in gin.

@deepmap-marcinr deepmap-marcinr merged commit e9033d1 into oapi-codegen:master May 5, 2023
@shirou shirou deleted the feature/add_internalservererror_on_gin_strict_handler branch May 6, 2023 03:17
adrianpk pushed a commit to foorester/oapi-codegen that referenced this pull request Jan 16, 2024
adrianpk added a commit to foorester/oapi-codegen that referenced this pull request May 31, 2024
danicc097 pushed a commit to danicc097/oapi-codegen that referenced this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants