ChorusOne / fastsync

Send files between machines quickly by leveraging multiple TCP connections
Apache License 2.0
5 stars 0 forks source link

Add friendly error messages for IO errors #5

Open ruuda opened 3 months ago

ruuda commented 3 months ago

Follow-up to this comment:

Currently we use io::Result in most places. These errors are not user-friendly, because they lose context about the file that we had a problem with (if it’s a file at all).

Also, all propagated errors get “handled” in main like so: https://github.com/ChorusOne/fastsync/blob/cfba4cc26f07426dc2f99a0ed6f5bae29df83a72/src/main.rs#L82-L91

I think it’s okay to crash the application in case of an IO error — I don’t think we need to be robust against transient failures, the user can just restart the transfer instead — but we can report clearly what went wrong and where.