catch errors, report and return