AbsaOSS / rn-indy-sdk

This code was starting point of https://github.com/hyperledger/indy-sdk-react-native where the work continues.
Apache License 2.0
11 stars 6 forks source link

fix android error signature not same as nodejs #24

Closed TimoGlastra closed 3 years ago

TimoGlastra commented 3 years ago

This mostly resolves #21 (but not fully yet).

I doubted between implementing error handling in NodeJS or Android. I went with Android for now because we need to call some internal function to get the full error.

However NodeJS is missing some error codes names in the wrapper (e.g. 212) which is present in the Java wrapper.

This is something that needs to be fixed in the NodeJS wrapper as it will return an incomplete error object for those missing error codes.

// Correct error JSON in NodeJS
{"name":"IndyError","message":"WalletAlreadyExistsError","indyCode":203,"indyName":"WalletAlreadyExistsError","indyCurrentErrorJson":null}

// Incorrect error JSON in NodeJS (due to missing code->name mapping in wrapper)
{"name":"IndyError","message":"212"}

However this is an easy fix in the NodeJS wrapper, I'll make sure to make the change shortly.

Edit: see https://github.com/hyperledger/indy-sdk/pull/2283