ksysoev / wasabi

Toolkit for Creating WebSocket API Gateways
MIT License
4 stars 2 forks source link

Improve error handling for sending responses #99

Closed ksysoev closed 6 days ago

ksysoev commented 1 week ago

We need to improve error handling for method Send of connection type. Currently there is no error handling on Write method call which leads to throwing errors like this:

2024/06/25 17:24:52 ERROR Error handling request: failed to write msg: failed to write frame: failed to flush: write tcp 127.0.0.1:8080->127.0.0.1:50165: write: broken pipe
2024/06/25 17:24:52 ERROR Error handling request: failed to write msg: failed to write frame: failed to write frame header: write tcp 127.0.0.1:8080->127.0.0.1:50165: write: broken pipe

instead of raw errors we should handle errors related to connection cloasure and return wasabi error ErrConnectionClosed