Issue information

Issue ID
#117
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Sep 25, 2007 13:06
Last Post
Hercules Elf Bot
Apr 19, 2012 18:07
Confirmation
N/A

Hercules Elf Bot - Sep 25, 2007 13:06

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=117

Currently socket error messages look like this:

[code][Error]: bind failed (socket 5, code 98)![/code]

This is very user-unfriendly, and even more so because these codes vary from system to system. Printing the error message would help users determine problems without digging through system headers or posting new topics in the forums.

For unix, there are the standard strerror(), and maybe strerror_r() functions. For Windows there's the winapi FormatMessage?() function (avoid strerror() since it doesn't handle socket codes).

A 'const char* errmsg(int code)' helper function should do the job. Problem is that the system will only provide messages into a prepared buffer, not directly as const*, therefore a static buffer will probably have to be used.

This post has been edited by Brian on Jan 25, 2012 4:50

Hercules Elf Bot - Jan 25, 2012 3:44

Originally posted by [b]Gepard[/b]
Fixed in [rev=15518].