mysql icon indicating copy to clipboard operation
mysql copied to clipboard

Question: why is ErrInvalidConn returned for all network read error?

Open ideascf opened this issue 3 years ago • 1 comments

Reading the code(https://github.com/go-sql-driver/mysql/blob/master/packets.go#L39), all network read errors are replaced by ErrInvalidConn. Can we distinguish read/write timeout from other errors? Is there a reason for the design here?

PS: sometime, we need to known there is a client read timeout error or server-side error

ideascf avatar Sep 27 '21 06:09 ideascf

I had the same problem, I submitted a pull request, but not sure this will eventually be merged into master #1348

archzkt avatar Aug 08 '22 09:08 archzkt

https://dave.cheney.net/2014/12/24/inspecting-errors

https://www.amazon.com/Philosophy-Software-Design-2nd-ebook/dp/B09B8LFKQL/ref=tmm_kin_swatch_0?_encoding=UTF8&qid=1685252148&sr=8-1 is also good book.

You must not think like "why is this hidden?". You must think like "why is this needed to be exposed?".

PS: sometime, we need to known there is a client read timeout error or server-side error

This can not be enough reason to make "information leakage".

methane avatar May 28 '23 05:05 methane