Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom status code on healthcheck #176

Closed
fabioimpe opened this issue Mar 15, 2021 · 2 comments
Closed

Custom status code on healthcheck #176

fabioimpe opened this issue Mar 15, 2021 · 2 comments

Comments

@fabioimpe
Copy link

Hi,
I was trying to set a custom status code on my healthcheck without success.
For instance I need to both customize the contract and the status code, but for what I can see from the code the failure is triggered by raising an Error, but in that way I cannot customise the contract.

Is this achievable in some way?
Thanks

@gergelyke
Copy link
Collaborator

hey @fabioimpe - as of right now, it's not possible due to

res.statusCode = 503

I'd be happy to accept a PR which checks if an error has a statusCode property, and if it has, it uses that instead of 503

@sindilevich
Copy link
Contributor

@gergelyke, @rxmarbles, thank you for advancing code changes that seem to resolve this issue now, since #190 was merged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants