hyperledger / aries-vcx

aries-vcx is set of crates to work with DIDs, DID Documents, DIDComm, Verifiable Credentials and Hyperledger Aries.
https://didcomm.org
Apache License 2.0
125 stars 83 forks source link

[BUG] Incorrect error type when publishing schema with indyvdr #1219

Open gmulhearn-anonyome opened 5 months ago

gmulhearn-anonyome commented 5 months ago

I'm finding that the indyvdr implementation of anoncreds ledger is returning "duplicate schema" errors for any invalid ledger response. The error mapping should be more controlled than this.

For instance, i was getting duplicate schema errors, but the real error was:

{0:"{"reason":"client request invalid: UnauthorizedClientRequest('Rule for this action is: 1 TRUSTEE signature is required OR 1 STEWARD signature is required OR 1 ENDORSER signature is required\nFailed checks:\nConstraint: 1 TRUSTEE signature is required, Error: Not enough TRUSTEE signatures\nConstraint: 1 STEWARD signature is required, Error: Not enough STEWARD signatures\nConstraint: 1 ENDORSER signature is required, Error: Not enough ENDORSER signatures',)","op":"REJECT","identifier":"Tm8G8wnWbCwYBEbxTTn2N2","reqId":1717979749424644000}"}

https://github.com/hyperledger/aries-vcx/blob/main/aries/aries_vcx_ledger/src/ledger/indy_vdr_ledger.rs#L600