tjscience / RoboSharp

RoboSharp is a .NET wrapper for the awesome Robocopy windows application.
MIT License
216 stars 67 forks source link

RoboCopyResults does not include -1 (Process/Job exited prematurely) #124

Closed RFBomb closed 2 years ago

RFBomb commented 2 years ago

@PCAssistSoftware
I swear that I had added the '-1' enum to this exit status, along an accompanying boolean status check to one of my pull requests/commits. I can't find out/remember which one had it though.

Anyway, the cause for that is because if the process encounters a serious error that simply causes the process to fail (or you cancel the job via RoboCommand.Cance()), you will get an exit code of -1 because robocopy didn't report a result, the process just exited without finishing.

In my program, since I allow users to cancel jobs, I have to check for the exit code value == -1. I believe this should be value within the enum since it is possible to come across.

PCAssistSoftware commented 2 years ago

I just check at the moment for the -1 value in my own GUI and then display my chosen message, so not an issue at all as far as I am concerned, but if you want to handle it internally then fine with me, and useful for others.

RFBomb commented 2 years ago

Yea, I suspect most others are doing the same. I just figured it ought to be included, since its a 'valid' result that can occur. I also just remembered thats its part of the Draft PR #113

RFBomb commented 2 years ago

Included in #127