fix error handling not to itself raise an exception

http://manage.dimagi.com/default.asp?116185

previously when there was an exception here, `xform` itself was often undefined, so that obviously didn't work...