I am writing an API that updates mongo DB data.
When I pass an ID which is not available then it's not throwing an error at `findByIdAndUpdate`. Instead it returns a blank result.

```
const update_data = async(data) => {

    try {

        const res = customReportModel.findByIdAndUpdate(data.input._id, data.input.body, {new: true}, function(err, model) {
            if(err) {
                console.error(error);
                const e = new Error(`Data with ${data.input._id} not found.`);
                throw e;
            }
            return model;
        })

    } catch (error) {

        console.error(error);
        const e = new Error('Error while updating.');
        throw e;
    }

}

```

Not sure why it's not throwing an error when the ID does not exist in the database.