better error reporting when materialize fails (now with backtrace)