Types of errors that can be returned in command submission versus completion

There are quite a large number of ledger API error categories and codes. When calling the CommandSubission service “submit” method, is there a smaller of subset of these error categories and/or codes that can result from this? Similarly, when a command completion result is returned by the CommandCompletionService, can we assume a smaller subset of error categories and/or codes? Can you provide a list of these categories and/or codes that can arise in these two situations?

Hi Huw,

The Ledger API docs list all the errors a service can return and are documented here

Errors for the CommandSubmissionService are documented here

Errors for the CommandCompletionService are documented here

Let me know if that helps.

Hi @rohitt , thanks, that is helpful - however - the errors documented are only gRPC statuses (not ledger API error categories or codes). Is it possible to provide similar information for ledger API error categories/codes? Additionally, the Completion documentation doesn’t outline all possible error statuses - looks like it’s just giving some examples. Can you provide a more detailed list for this?

Hi @huw ,

We do not have a classification of all possible returned Ledger API error codes per endpoint/response type.

May we ask why do you need such a classification? If your intention is to automate the app client’s behavior based on the returned error code, you could generally set some automation rules based on the error category (e.g. based on the retryability information - see Error Codes — Daml SDK 2.4.0 documentation). Otherwise, most error codes need targeted inspection in order to be resolved.

1 Like

Yes, the use case is to automate client behavior. Unfortunately, error categories are too broad in some cases for us to use them, we need to use error codes in such cases. However the number of different error codes makes them unwieldly to handle and can lead to large amounts of code dedicated to various error codes. I understand error codes might be difficult to document completely per endpoint - I guess some may depend on the ledger implementation. Do you at least have a complete list of ledger API error categories per endpoint?