Better handling of unexpected errors in command/chain