Enhanced error tracing