There's a simplerThe actual solution:
#!/bin/bash
function bla() {
return 1
}
bla || { ( echo '1' ) &&'1'; exit 1; }
echo '2'
The error grouping will only execute if bla returns an error status, and exit is not in a subshell so the whole script stops.