instead of

whenever sqlerror use whenver oserror

easy huh

look your sqlplus documentation for further details