error handling rewrite: making sure to pass backtrace