On 2018-Sep-25, Tom Lane wrote: > Michael Paquier <mich...@paquier.xyz> writes:
> > Ok. I won't fight hard on that. Why changing the error message from > > "could not load netmsg.dll" to "unrecognized winsock error" then? The > > original error string is much more verbose to grab the context. > > As the code stands, what you'll get told about is the error code > returned by the failed LoadLibrary call; the original winsock error > code is reported nowhere. I think that's backwards. I agree that the winsock problem is the main one we should be reporting, including its numeric error code. Even if we can't translate it, the numeric value can be translated by web-searching, if it comes to that. > We could possibly write something like > > sprintf(wserrbuf, "winsock error %d (could not load netmsg.dll to translate: > error code %lu)", err, GetLastError()))); > > but I'm unconvinced that that's useful. Actually I think it *is* useful to do it like this, because then the user knows to fix the netmsg.dll problem so that they can continue to investigate the winsock problem. If we don't report the secondary error message, how are users going to figure out how to fix the problem? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services