Description
(After writing this up, I actually searched and this may be related to: #20 #33 (though It's not the user resizing the screen, it's RDP)
Edit: Tangentially related to #89, too. I have not seen that one again since reporting, though.
Hello there, come up against an issue when calling .Refresh()
, that very occasionally throws an out of range exception
Event log shows:
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentOutOfRangeException
at System.String.CtorCharCount(Char, Int32)
at Konsole.ProgressBarSlim.Refresh(Int32, System.String)
at DharaImport.CLI.Program.Main()
Exception thrown in CtorCharCount
seems to be when count
is negative:
And I think the part of your code that even hitting that .Net call is:
konsole/src/Konsole/ProgressBarSlim.cs
Line 106 in a070ce7
The application I have using this library is a console application that sits in a session on a remote machine that multiple people access. My current hypothesis is that it is something to do with the window being resized when someone connects with a client with a much smaller resolution than normal (i.e RDP on a phone)
Obviously this is an edge case, and I think it's more to do with something that is going on on my end rather than yours, but figured I would report to you in case there were any opportunities to safeguard against the exception from your side (for now I'm just going to wrap all calls to Refresh
in a try catch and actually handle the exception 🙃)