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

rn-indy-sdk errors do not match indy-sdk errors #21

Closed TimoGlastra closed 3 years ago

TimoGlastra commented 3 years ago

Problem

Errors thrown by rn-indy-sdk do not have the same signature as errors thrown by indy-sdk. For example in aries-framework-javscript when an error is thrown when trying to create a wallet we check whether the indyName of the error is WalletAlreadyExistsError. However the same error in rn-indy-sdk does not have the property indyName and therefore aries-framework-javascript will crash (see image and Unhandled promise rejection below)

'Unhandled promise rejection', [Error: {"code":"203","message":"org.hyperledger.indy.sdk.wallet.WalletExistsException: A wallet with the specified name already exists."}]

image

How to Solve

We discussed during aries-framework-javascript call and came to the conclusion we need to update IndySdkRejectResponse class (on Android side, not looked at iOS yet) to match the indy-sdk for NodeJS error.

https://github.com/AbsaOSS/rn-indy-sdk/blob/43aff51c158cb871c12ce4247aa7df74690e51da/android/src/main/java/com/reactlibrary/IndySdkModule.java#L730-L765

TimoGlastra commented 3 years ago

@jakubkoci @karimStekelenburg

TimoGlastra commented 3 years ago

@thearhaam we figured out what the problem is with initialisation of the framework.

TheArhaam commented 3 years ago

@TimoGlastra Oh glad to know the problem was found 😄