Add location information to `error` and `undefined`