Merge "Add onDetectionError API" into main