Java Command client submitAndWait behaviour on error

The Java CommandClient in the java bindings accepts a list of commands. Is it correct to assume that where a list of commands are submitted, say 10 and the 4th failed due to something like an assertion not being met on a template. The first 3 have been successfully executed (despite the blow up) or is it an all or nothing?

It’s an all or nothing, similarly to how submit in a Daml Script is an all or nothing. If you don’t want an all or nothing, you have two main options:

  1. Split it into separate submissions. Then each submission can fail on its own.
  2. Try to handle the errors via Daml exceptions so the exception gets caught and you can continue. Note that not all errors are catchable though so this only works for some cases.
1 Like

Thanks will go for option 1 then. Are there any utils (now or coming in the future) to parse the blanket grpc exception that gets thrown (or maybe even throw them as daml specific ones?

1 Like

There is no tooling available at the moment. I recommend looking at the docs to get an idea of the errors you’ll get.