Calling sql file from shell script

Hi

I have a shell script that call a sql file. The sql file will create a spool file.

My requirement is, when ever i get an OS error like file not found. I have to log it in a log file.

Could some who worked in a like scenario help me by giving the code sample.

Many Thanks..

if [[ ! -e /some/file.sql ]]; then
     echo nothing found
else
     echo found it
fi

exit 0