Skip to content

Exceptions during hg push should be errors#367

Open
rmunn wants to merge 1 commit intomasterfrom
bug/push-exceptions-should-be-errors
Open

Exceptions during hg push should be errors#367
rmunn wants to merge 1 commit intomasterfrom
bug/push-exceptions-should-be-errors

Conversation

@rmunn
Copy link
Contributor

@rmunn rmunn commented Feb 26, 2026

The IProgress implementations have an ErrorEncountered flag that is set when their WriteException or WriteError methods are called. But PushToTarget was only calling WriteMessageWithColor, so if the only exception during a Send/Receive was happening during the hg push step, then ErrorEncountered was incorrectly still false.

Fixes #366.


This change is Reviewable

The IProgress implementations have an ErrorEncountered flag that is set
when their WriteException or WriteError methods are called. But
PushToTarget was only calling WriteMessageWithColor, so if the only
exception during a Send/Receive was happening during the hg push step,
then ErrorEncountered was incorrectly still false.
@rmunn rmunn self-assigned this Feb 26, 2026
@rmunn
Copy link
Contributor Author

rmunn commented Feb 26, 2026

Note that this might change the output of any code that uses SIL.Windows.Forms.Progress.LogBox as the progress dialog, because LogBox writes a full exception stacktrace in its WriteException implementation, rather than just the exception message as the existing code was doing. If this matters, a possible fix would be WriteError(err.Message) instead of WriteException, but that would potentially lose useful debugging info that users might copy and paste into an email. So I chose to use WriteException here, but I'll change it if requested.

@github-actions
Copy link

Test Results

       8 files  ±0     333 suites  ±0   2h 34m 24s ⏱️ + 11m 23s
   988 tests ±0     932 ✔️ ±0    56 💤 ±0  0 ±0 
3 145 runs  ±0  3 022 ✔️ ±0  123 💤 ±0  0 ±0 

Results for commit 0925bb5. ± Comparison against base commit 1ab24b9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chorus doesn't call IProgress.WriteException on push errors

1 participant