Coder Social home page Coder Social logo

Comments (10)

msfeldstein avatar msfeldstein commented on August 14, 2024 1

Where does ACCOUNT_MERGE_HAS_SUB_ENTRIES get converted to op_has_sub_entries? I think its important that we actually have the actually opcode listed so people can google for it.

from docs.

ire-and-curses avatar ire-and-curses commented on August 14, 2024 1

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.

from docs.

msfeldstein avatar msfeldstein commented on August 14, 2024

Looks similar to #179 which was closed but I don't think it was solved

from docs.

bartekn avatar bartekn commented on August 14, 2024

For reference the codes can be found in codes package. I think that primary reason for this was to merge similar error codes into one, ex. all different operation success codes are now op_success. But you are right we should either update the docs or display original errors returned by stellar-core in Horizon response.

from docs.

ire-and-curses avatar ire-and-curses commented on August 14, 2024

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 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 @tomerweller @rice2000 what are your thoughts?

Update: I hadn't internalised that tx_bad_auth is actually a protocol level error. Thanks for pointing that out @tomerweller.

from docs.

msfeldstein avatar msfeldstein commented on August 14, 2024

from docs.

tomerweller avatar tomerweller commented on August 14, 2024

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.

from docs.

msfeldstein avatar msfeldstein commented on August 14, 2024

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.
stellar/js-stellar-sdk#413

from docs.

tomerweller avatar tomerweller commented on August 14, 2024

Main offender: https://github.com/stellar/go/blob/8affeed3c57d334f7a5e47099007259b80fccb75/services/horizon/internal/codes/main.go#L38

from docs.

rice2000 avatar rice2000 commented on August 14, 2024

It looks like this situation has been improved by the API Reference section of the new docs here: https://developers.stellar.org/api/errors/result-codes/

Is that sufficient to solve this issue?

from docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.