-
Notifications
You must be signed in to change notification settings - Fork 106
URL in Problem.Type doesn't exist #393
Comments
Also, looks like // ResultCodes extracts a result code summary from the error, if possible.
func (herr *Error) ResultCodes() (*TransactionResultCodes, error) {
if herr.Problem.Type != "transaction_failed" {
return nil, ErrTransactionNotFailed
} We need another field that will only contain error code - without URL to an error. |
I'd vote for dropping the URL |
@jedmccaleb moving away from the url wouldn't be compliant with https://tools.ietf.org/html/rfc7807 I'm a bit miffed that our first instinct is that the server is designed wrong in this situation when it looks to me like the client never worked for this scenario. The nice thing about using a URL is that it should be resolvable to the docs for that error. We haven't yet done that work, but we probably should. I mean, I'm fine with us scrapping HAL and Problems and doing something entirely on our own if you guys think it will make things easier for devs, but let's not pretend like its going to solve the situation that gave rise to this problem... the docs even include an example using the full url: https://github.com/stellar/horizon/blob/master/docs/reference/errors/transaction-failed.md |
I agree, that's is why I suggested:
According to specification, it's possible to extend problem object: Extension Members. My main concern with using URL in The other thing is that the code in |
If we're just going to use the "Do whatever you want" features of the spec to avoid using the spec how it was intended (the type URI is the identifier to switch on) then IMO we should just do our own thing.
They won't be changing. We need to implement redirects at those URLs to redirect into the documentation.
nonono :) "title" is a human readable field, we shouldn't be coding against it. A client would render the title to the user to explain why their request failed:
I'm cool with that, but this isn't the root problem IMO... We're trying to do too much on too many different projects without enough collaboration and shared code. this specific issue was "Hey, we've got this thing that looks like a horizon client in the bridge server, why don't we just import it into the monorepo minimally so others can use it?" We chose the quick solution because we didn't have enough resources to choose the correct solution. |
Then OK, EOT. |
https://github.com/stellar/horizon/blob/08885e0bae6fb2eb5ecece05483cbae0d35816e7/src/github.com/stellar/horizon/render/problem/main.go#L58
The text was updated successfully, but these errors were encountered: