[storage] no need to mark as failed diff scheme on cancel

This commit is contained in:
Arsentiy Milchakov 2020-01-16 12:59:59 +03:00 committed by Daria Volvenkova
parent 75f4658029
commit f82ec33ed7

View file

@ -143,22 +143,24 @@ DiffApplicationResult ApplyDiff(string const & oldMwmPath, string const & newMwm
switch (version)
{
case VERSION_V0: return ApplyDiffVersion0(oldReader, newWriter, diffFileSource, cancellable);
default: LOG(LERROR, ("Unknown version format of mwm diff:", version));
case VERSION_V0:
return ApplyDiffVersion0(oldReader, newWriter, diffFileSource, cancellable);
default:
LOG(LERROR, ("Unknown version format of mwm diff:", version));
return DiffApplicationResult::Failed;
}
}
catch (Reader::Exception const & e)
{
LOG(LERROR, ("Could not open file for reading when applying a patch:", e.Msg()));
return DiffApplicationResult::Failed;
}
catch (Writer::Exception const & e)
{
LOG(LERROR, ("Could not open file for writing when applying a patch:", e.Msg()));
return DiffApplicationResult::Failed;
}
return DiffApplicationResult::Failed;
return cancellable.IsCancelled() ? DiffApplicationResult::Cancelled
: DiffApplicationResult::Failed;
}
string DebugPrint(DiffApplicationResult const & result)