script exits when error occurs

Hi!
My script:
:foreach adr in [/ip route find gateway=1.2.3.4] do {
:local dst [/ip route get $adr dst-address]
:if ($dst != “0.0.0.0/0”) do {
/ip firewall address-list add list=1234_nets address=$dst
}
}

adds networks to address-list. But, if an “address ranges may not overlap” error occurs script exits.
Is it possible to continue script running if an error occurs?
Thanks.

Hi,

I don’t think so. You will have to find a workaround for it.

Just add an additional check if address added to address list already exist.