Add debug output in error path.