zio / zio-ftp

A simple, idiomatic (S)FTP client for ZIO
https://zio.dev/zio-ftp
Apache License 2.0
29 stars 13 forks source link

InvalidPathError sometimes return erroneously #227

Open codingismy11to7 opened 2 years ago

codingismy11to7 commented 2 years ago

haven't done enough research on this yet to know exactly why/when it happens or how to fix it. But I saw an instance where i rebooted my router and a couple of downloads that were starting returned this error. There are many reasons why FTPClient can return null from retrieveFileStream, and not all of them indicate that it's an invalid path... but the library reports them all as that error.

in my case the server returns some messed up filenames when listing directories but then fails when trying to retrieve them (problem with their server software) so in the InvalidPathError case i give up on the file instead of retrying it later. but for these failures when it was beginning the downloads right when my machine lost internet, that error probably shouldn't have been returned because the server did retrieve them when i manually retried later.

anyway, I'll try at some point to track down some way of distinguishing the reason for the null response, but wanted to be sure to open an issue for posterity