Make handleError just use a passed err