ensureError is works for inheritance classes, now