-
Notifications
You must be signed in to change notification settings - Fork 256
Add opcodes in list of operations #507
Comments
Looks similar to #179 which was closed but I don't think it was solved |
For reference the codes can be found in |
I don't really see the value in merging the similar codes into a smaller number of generic codes. Whether generic or not the caller probably needs to track the context of what was sent, to choose an appropriate specific follow-up action to the error (e.g. retry vs abort). Also the original stellar core errors reflect the underlying XDR, and I think abstracting this here doesn't aid comprehension.
So:
Update: I hadn't internalised that |
Agree with eric, and as a tiny point i'd mention on that page that bad auth
is often caused by signing for the right network
…On Thu, Sep 5, 2019 at 11:00 AM Eric Saunders ***@***.***> wrote:
I don't really see the value in merging the similar codes into a smaller
number of generic codes. Whether generic or not the caller probably needs
to track the context of what was sent, to choose an appropriate specific
follow-up action to the error (e.g. retry vs abort). Also the original
stellar core errors reflect the underlying XDR, and I think abstracting
this here doesn't aid comprehension.
tx_bad_auth is slightly different though. This is an error at the
transaction level, because Horizon validated your TX and concluded it would
never work (due to bad/missing signature and/or bad network passphase).
Documentation for this (and other Horizon validation checks) should be
clearly linked in the returned error. We do have a decent doc page here
<https://www.stellar.org/developers/horizon/reference/errors/transaction-failed.html>
so I think the issue is making sure we link to it.
So:
1. We should fix the docs to link to the Horizon errors (probably at
the top of list of operations)
2. Overall I think I'm in favour of changing the codes to be explicit.
This would be a pretty major breaking change. @TomQ
<https://github.com/TomQ> @tomerweller <https://github.com/tomerweller>
@rice2000 <https://github.com/rice2000> what are your thoughts?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#507>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABHK37K6XRJPYT7IWFD6UDQIFCKFANCNFSM4ITVKIDQ>
.
|
I agree with @ire-and-curses. The return codes are well defined and documented in the transactions xdr definitions (txBAD_AUTH example). Abstracting over these is causing us unnecessary pain. We can import these error comments to the horizon documentation and even use them to generate human readable error messages in the response from a failed transaction submission. |
Where does |
Regarding it being a breaking change, if that's too much to handle we can add the real opcodes in addition. I also have a bug filed in js-sdk to surface these errors via the sdk, and if we implement that we could change this behavior under the covers to not break anything. |
It looks like this situation has been improved by the Is that sufficient to solve this issue? |
As you point out @rice2000, the new docs have the Horizon errors and the mapping to XDR opcodes. I think this is sufficient for the docs issue. I'll open an issue on Horizon to discuss whether to make the breaking change to move to explicit opcodes in a future version of the API. |
It is difficult to find info on what horizon errors mean.
When a horizon call fails, it returns an opcode (
tx_bad_auth
for example) and sends you to our docs for more info. It saysDescriptions of each code can be found at: https://www.stellar.org/developers/learn/concepts/list-of-operations.html"
however when you get to that page if you try to search for your opcode nothing comes up. We should have the actual opcodes next to the horizon error codes.tx_bad_auth probably is ALLOW_TRUST_TRUST_NOT_REQUIRED but i'm not really sure. It would be great to know for sure.
The text was updated successfully, but these errors were encountered: