vacuumlabs/cardano-hw-cli

Improve error message reporting

Closed this issue · 2 comments

@janmazak can we improve the reporting of the errors. for example this is the return of hw-cli when a ledger device is connected, unlocked but the cardano-app is not opened.

$ cardano-hw-cli device version
Error: General error 0x6e01. Please consult https://github.com/cardano-foundation/ledger-app-cardano/blob/master/src/errors.h

i would like to report a better cleartext message back to the user. not sure if there would always be such a reported error 0x6e01 for the same situation?

I'm investigating what can be done about it.

  1. 0x6e01 is ERR_MALFORMED_REQUEST_HEADER (https://github.com/vacuumlabs/ledger-app-cardano-shelley/blob/786243fe4acbdf55b452b251f981b4f9901983a9/src/errors.h#L14) if thrown by the Cardano app, but that does not seem to be the case here.
  2. There is error 0x6e00 that typically occurs when a wrong app is opened, and possibly if no app is opened (thrown by Ledger, not the Cardano app): https://github.com/vacuumlabs/ledgerjs-cardano-shelley/blob/db6aeeb0c338712d769a4d7281d0fa5f07c20a48/src/errors/deviceStatusError.ts#L29
    However, I've never managed to obtain a list of exceptions thrown by Ledger itself, despite asking it from Ledger. Maybe with the new SDK it will become more transparent and then I can try to fix this.

I also ran into this issue. I closed the Eternl wallet browser tab, which may have been "occupying" the ledger, and now it works...although once it run, there's literally no indication it successfully ran either, or where the output files are located. Definitely second better error messages, and success messages.