to catch error events you need to declare error boundary event with coresponding error code. If you use 5.2 then error boundary event can be attached to only sub processes from 5.3 you can attach boundary events on tasks as well. Once error event is caught you can start alternative path in the process. Take a look at the example here
HTH