Hello, could the $err:line-number [1] variable help you ? [1] http://docs.basex.org/wiki/XQuery_3.0#Try.2FCatch Best regards, Fabrice ETANCHAUD cerfrancepch