Handling Active/Passive swap in Java client

Is there a recommended design pattern for dealing with a participant node active/passive switch from java clients. As while a passive node will continue to serve reads to a grpc client it will fail on a write (understandably)

For example lets say both sit behind a load balancer that always routes to the active one based on the health pings. If a client establishes a connection on start up to the active node and at some point the active one becomes passive then it will be met with the below error on a write operation:

UNAVAILABLE: NODE_IS_PASSIVE_REPLICA(1,4f483456): Cannot process submitted command. This participant is the passive replica.

Can the passive replica be configured to route the request to the active one or must the client handle the failure and reconnect. If so any tips how?