nec: process errors more carefully