digital-asset / daml

The Daml smart contract language
https://www.digitalasset.com/developers
Other
802 stars 204 forks source link

The "not all parties known" error is not sufficiently useful #7004

Open ghost opened 4 years ago

ghost commented 4 years ago

Originally reported by @shineli-da on the forum.

When exercising a choice using a party that's yet to be allocated (on a ledger without implicit party allocation), we receive the error: Status(3,Party not known on ledger: Not all parties known,Vector()).

Unfortunately, the status code (3, or INVALID_ARGUMENT) is not granular enough to be able to handle the error, as there are many different kinds of invalid argument.

To automatically do something useful with this error message, the operator will need to parse the error description, looking for something resembling "Party not known on ledger" or "Not all parties known". In addition, we do not report the name of the missing party, which could potentially lead to an expensive wild goose chase.

To make this error (and other similar errors) useful, I propose we need structured error messages, containing a custom error code in addition to the general-purpose GRPC status code.

leo-da commented 4 years ago

When/If it is implemented, please ping @S11001001 and @leo-da we would need to update how JSON API handles Ledger API errors and make sure the error code gets properly exposed to JSON API users.