parallaxinc / PropLoader

Parallax Propeller loader supporting both serial and wifi downloads
MIT License
27 stars 13 forks source link

Remove error code (-1) from Download Failed error #41

Closed PropGit closed 7 years ago

PropGit commented 7 years ago

The error code is always -1 in practice.

Remove error code (and colon) from the Download Failed message so it appears like this instead: 102-ERROR: Download failed

dbetz commented 7 years ago

What if I instead return different error codes for different failures? Wouldn't it be good to know at what stage the failure occurred?

PropGit commented 7 years ago

Wouldn't it be good to know at what stage the failure occurred?

Yes, that's what the message just before the download failure message was intended for.

What if I instead return different error codes for different failures?

Can you make it return the error code we've specified as the code for the errors that now (and in the future) display just before the "download failed" message? For example, the code used for RAM Checksum Failure, or EEPROM Checksum failure, noted in the other issues in May Release v1.4 milestone.

zfi commented 7 years ago

The issue I reported was that the return code was always a (1) regardless of what caused the failure. It would be helpful to have distinct exit error codes from each branch where a failure is detected.

@PropGit: Please note that the exit code set in the source is not a (-1). The '-' is coming from the printf statement that is inserting a dash in front of the exit code. The python app that is calling proploader is always seeing a '1' when the proploader errors out.

dbetz commented 7 years ago

Yes, that is correct. The Gproploader exit code is always either 0 for success or 1 for failure. I think Jeff is talking about the code printed in the error message though.

PropGit commented 7 years ago

Thanks @zfi.

Yeah, I agree is a code that relates directly to the exact fatal condition. If the -c option is used, that code should already be output at the start of the message immediately preceding this Download Failed message (for the cases we enabled to do that... it's not completely implemented for all errors yet.) Without the -c option, this code would still be available in this last message.

PropGit commented 7 years ago

Yes, I was talking about the displayed error code; the one I see over and over again every time I do something wrong. :-)

dbetz commented 7 years ago

done

PropGit commented 7 years ago

Verified in v1.0-37