mysql
mysql copied to clipboard
Question: why is ErrInvalidConn returned for all network read error?
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
I had the same problem, I submitted a pull request, but not sure this will eventually be merged into master #1348
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".