Closed n3wscott closed 6 years ago
I agree, the library should have semantic meaning for certain type of errors that the handler understands and can then return the correct error responses.
Oh! maybe it is fixed? https://github.com/pmorie/osb-broker-lib/pull/27
Not fixed yet. #27 was a good first start.
This works and is good enough for me:
return nil, osb.HTTPStatusCodeError{
StatusCode: http.StatusBadRequest,
ErrorMessage: strPtr("InvalidParameters"),
}
Current code example is this:
I have no option to return a bad args error or similar error. Perhaps we wrap error returned from the logic methods with some way to tell the handler method to return OSB errors and we can grab the description from the error returned or something.