Use @ERROR and @SERROR to check for errors and take a look at the ERR() UDF. This is a custom UDF performing notificatons in case of errors.
code:
copy $a $b
$rc=err('Error while copying '+$a+' to '+$b)

_________________________
There are two types of vessels, submarines and targets.