Add backtrace to error function