It is mustahabb for a person to complete a non-obligatory fast or non-obligatory prayer he has began. It is permissible for him to exit the fast or prayer without having to make it up regardless of if he exits based on a legitimate excuse or not. This is the opinion of the following Companions:
It is the opinion, among the jurists, of 'ishaaQ, Maalik, and al-thawri.
Maalik holds the opinion that it is permissible to exit a non-obligatory prayer or fast for a legitimate reason. If a person exits the act before completing it without a legitimate excuse then it is necessary for him to make it up.
Abu Hanifah holds the opinion that one has to make up the non-obligatory prayer or fast if he exits the act prior to completion regardless of if he exits because of a legitimate excuse or not.
Volume 3 Page 468