Refine error report and args passing of secure_sharing.