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

Error in REST audit layer produces misleading error responses in metal-api #163

Open
Gerrit91 opened this issue Jan 30, 2025 · 1 comment · May be fixed by #164
Open

Error in REST audit layer produces misleading error responses in metal-api #163

Gerrit91 opened this issue Jan 30, 2025 · 1 comment · May be fixed by #164

Comments

@Gerrit91
Copy link
Contributor

We only set return code in case an audit error occurs and interrupt the request chain. If this happens the metal-api does not send back an error response JSON object, which was defined in the Swagger spec. Therefore errors from metal-go will be outputted like this:

Received unexpected error:
[DELETE /v1/machine/{id}/free][500] freeMachine default "{\"statuscode\":0,\"message\":\"\"}"
@Gerrit91
Copy link
Contributor Author

A way to improve this would be to allow passing an error callback function, which is called in case an error occurs in the filter like func(err error, response resp *restful.Response) such that the caller can send the appropriate error response.

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 a pull request may close this issue.

1 participant