From f82ec33ed748860786737dddbea5bd1a8fbc9044 Mon Sep 17 00:00:00 2001 From: Arsentiy Milchakov Date: Thu, 16 Jan 2020 12:59:59 +0300 Subject: [PATCH] [storage] no need to mark as failed diff scheme on cancel --- generator/mwm_diff/diff.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/generator/mwm_diff/diff.cpp b/generator/mwm_diff/diff.cpp index 26069ebdd3..1166dd8d3d 100644 --- a/generator/mwm_diff/diff.cpp +++ b/generator/mwm_diff/diff.cpp @@ -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)