4 Oct
2021
4 Oct
'21
9:28 p.m.
On 10/04/21 at 08:09pm, morganamilo wrote:
This is the error value generally used and the calling function explicitly checks for -1, later causing the error to be missed and the transaction to continue.
This result is not compared to -1, the result of download_files is. If we want to guarantee that download_files will return -1 on error, that's where the return should be normalized, not in find_dl_candidates. Tying the API of one function to another like this is just going to cause confusion and breakage when somebody forgets in the future. Really, the caller of download_files should just check for a successful return; we return 1 as an error from lots of functions.