Expanding error trap