wormhole-william icon indicating copy to clipboard operation
wormhole-william copied to clipboard

More graceful errors when cancelled

Open Jacalz opened this issue 3 years ago • 3 comments

As of https://github.com/psanford/wormhole-william/commit/049df45b8d5a40e6f5f3f43ea7d8c423631ed7ed, cancelling incomming and outgoing connections works great. However, it would be nice if the errors could be a bit more graceful. This does not affect the latest stable release yet.

Cancelling the outgoing send returns this (first error being in the sending end and the second in the receiving end):

2021/05/20 21:01:28 Fyne error:  Error on sending file
2021/05/20 21:01:28   Cause: write tcp 192.168.1.220:43901->192.168.1.220:36580: use of closed network connection
2021/05/20 21:01:28   At: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/internal/transport/bridge/send.go:112
2021/05/20 21:01:28 Fyne error:  Error on copying contents to file
2021/05/20 21:01:28   Cause: unexpected EOF
2021/05/20 21:01:28   At: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/internal/transport/receiver.go:71

Cancelling the incoming receive returns this. Here, the first error (from the receiving end) is what I would like to see, but the second error is not quite as graceful.

2021/05/20 21:02:02 Fyne error:  Error on copying contents to file
2021/05/20 21:02:02   Cause: context canceled
2021/05/20 21:02:02   At: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/internal/transport/receiver.go:71
2021/05/20 21:02:02 Fyne error:  Error on sending file
2021/05/20 21:02:02   Cause: write tcp 192.168.1.220:43167->192.168.1.220:55670: write: connection reset by peer
2021/05/20 21:02:02   At: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/internal/transport/bridge/send.go:112

I would like it if all the errors could fail gracefully with "context cancelled".

Jacalz avatar May 20 '21 19:05 Jacalz

It would also be great if the "context canceled" error could be exposed somewhere (I could not find where it is created). This would allow me to check if it was cancelled and then avoid showing a bunch of error messages to the users in wormhole-gui.

Jacalz avatar May 20 '21 19:05 Jacalz

It would also be great if the "context canceled" error could be exposed somewhere (I could not find where it is created). This would allow me to check if it was cancelled and then avoid showing a bunch of error messages to the users in wormhole-gui.

Is context.Canceled not what you're looking for?

bryanchriswhite avatar May 28 '21 07:05 bryanchriswhite

It would also be great if the "context canceled" error could be exposed somewhere (I could not find where it is created). This would allow me to check if it was cancelled and then avoid showing a bunch of error messages to the users in wormhole-gui.

Is context.Canceled not what you're looking for?

Ah, silly me. Don’t know how I didn’t find that when I was looking at that package. Thanks :)

Jacalz avatar May 28 '21 07:05 Jacalz