The usage of $ZTRAP is discouraged. You should use a TRY/CATCH block instead.

See