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

Is the FailureResponse status code used? #162

Closed
renier opened this issue May 16, 2021 · 4 comments · Fixed by #165
Closed

Is the FailureResponse status code used? #162

renier opened this issue May 16, 2021 · 4 comments · Fixed by #165

Comments

@renier
Copy link
Contributor

renier commented May 16, 2021

I ask because I have an implementation like this:

func (f *serviceBroker) Services(ctx context.Context) ([]domain.Service, error) {
	return nil, apiresponses.NewFailureResponse(errors.New("TODO"), http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) // TODO: Implement
}

but going to /v2/catalog gives me this http response:

$> curl -i -u ":" -H "X-Broker-API-Version: 2.13" http://localhost:8080/v2/catalog
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
Correlation-Id: c2g7orea0bri9krepjs0
Date: Sun, 16 May 2021 01:59:09 GMT
Content-Length: 23

{"description":"TODO"}

Using v8 of this module.

Based on the docs here, I expected the response status code to be 501 instead.

@renier
Copy link
Contributor Author

renier commented May 16, 2021

Yep, it's a problem specifically with the catalog handler here. It should have been coded to test for a FailureResponse error like this.

@FelisiaM
Copy link
Contributor

Hi @renier

Thanks for catching this.
Would you be open to creating a PR with the change and corresponding tests for it?

Thanks,
Felisia

@renier
Copy link
Contributor Author

renier commented May 17, 2021

@FelisiaM Ok. See #165

FelisiaM pushed a commit that referenced this issue May 24, 2021
* Detect FailureResponse errors in Catalog handler

Closes #162

* imports grouping fix
@FelisiaM
Copy link
Contributor

Thank you for your contribution @renier!

This change will be included in the next release in a few days.

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.

2 participants