Artifacts Associated With Ticket 800716ffffffffff
Ticket change [2aca1d5917] (rid 118633) by davygrvy on 2003-09-04 21:37:59:
- assignee initialized to: "stwo"
- cmimetype initialized to: "text/plain"
- comment initialized to:
TclWinConvertError and TclWinConvertWSAError are private internal functions. They could be very useful to extension authors. I see a need for it. Let's make them public. Also, TclWinConvertWSAError doesn't map to all WSAE* error codes. Included are mappings to all of them. Unfortunetly, all the added can only return EINVAL until the posix codes they translate into get more meaningful to windows. Effectively, the behavior is still unchanged. Example: WSA_QOS_POLICY_FAILURE, 'rejected for administrative reasons - bad credentials' WSAEPROVIDERFAILEDINIT, 'The requested service provider could not be loaded or initialized' What posix codes do those get? Some detective work needs to be done with these. I really don't have a clue. The main reason I want to enlargen the mappings is to include WSAHOST_NOT_FOUND. I hate that the [socket] command can only return 'invalid argument' instead of 'authoritative host not found' or 'try again', or .... Should this really be a TIP?
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "davygrvy"
- subsystem initialized to: "52. Portability Support"
- title initialized to:
publicize TclWinConvertError and TclWinConvertWSAError
- type initialized to: "Patch"
Ticket change [12b1ba2333] (rid 124087) by davygrvy on 2003-09-05 04:38:00:
- icomment:
File Added - 60637: patch.txt
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Add attachment "patch.txt" [4a274eef40] (rid 126490) by davygrvy on 2003-09-05 04:38:00.
Ticket change [2a69756dcc] (rid 118565) by davygrvy on 2003-09-05 17:35:46:
- icomment:
Logged In: YES user_id=7549 It would be nice also, if Tcl_ErrnoMsg() returned localized strings.
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [b95a8ed2d0] (rid 129125) by davygrvy on 2003-09-05 18:51:57:
- icomment:
Logged In: YES user_id=7549 Please ignore that last post. That would break ALL scripts that did matching on error messages ;)
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [8e59eb5a4c] (rid 120102) by dgp on 2003-09-05 21:58:23:
- icomment:
Logged In: YES user_id=80530 Localized error messages are still a good idea, just one that needs to wait for a more thorough use of ::errorCode for script processing. jenglish and kbk both have ideas on this, but over a fairly extended time frame.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [8cf218dead] (rid 127828) by davygrvy on 2003-09-10 07:05:07:
- icomment:
Logged In: YES user_id=7549 Here's another patch that adds Tcl_Win32Error(), Tcl_Win32ErrId(), Tcl_Win32ErrMsg(), and Tcl_Win32ErrMsgVA (). The concept of setting errno and returning from a function is usually then displayed to the user with Tcl_PosixError() in a generic layer for setting $errorCode. Tcl_Win32Error() is exactly analogous to that, except that it gets the error code from GetLastError() for the exact windows error. I would use this from an extension! See the shift? Instead of returning from a function with errno set, give the function the interp and let it set $errorCode itself. This concept is working well in a project I'm doing. NOTHING is getting lost in a translation as there aren't any to be made! Tcl_Win32ErrId() is 100% complete and match the october 2002 release of the platform SDK. Error messages are asked for from the system with FormatMessage and could support localization... win/tclWinError.c builds with stock VC5, VC6, and with the platform SDK headers, too. my wrists are sore.. where's an ice pack in this house?
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Add attachment "patch.zip" [759343a11d] (rid 105413) by davygrvy on 2003-09-10 07:07:42.
Ticket change [838e13c824] (rid 117401) by davygrvy on 2003-09-10 07:07:42:
- icomment:
File Added - 61125: patch.zip
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [11f5b82df8] (rid 95234) by davygrvy on 2003-09-10 07:18:50:
- icomment:
Logged In: YES user_id=7549 Code could be added so that if Tcl(_)WinConvertError can't make the translation, the native message could be used instead. But Tcl is supposed to the great equilizer, and this new concept might be foriegn as it attemps to break from 'least common denominator' hole and might not be helpful for the places that are to provide a generic interface. In places where the native message is desirable, the ability to get it, is now easy.
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [0a8d85cd2c] (rid 113840) by davygrvy on 2003-09-10 08:13:24:
- icomment:
Logged In: YES user_id=7549 Here's some code that shows how an extension could make use of this feature: CONST char * ExpWinExpError TCL_VARARGS_DEF(Tcl_Interp *, arg1) { CONST char *id, *msg; va_list argList; Tcl_Interp *interp; DWORD err = GetLastError(); interp = TCL_VARARGS_START(Tcl_Interp *, arg1, argList); /* * If the "customer" bit is set, this error is ours. else forward * it to the system. */ if (errorCode & (0x1 << 29)) { id = ExpWinExpErrId(err); msg = ExpWinExpErrMsgVA(err, argList); Tcl_SetErrorCode(interp, "EXPECT", id, msg, 0L); } else { id = Tcl_Win32ErrId(err); msg = Tcl_Win32ErrMsgVA(err, argList); Tcl_SetErrorCode(interp, "WIN32", id, msg, 0L); } va_end(argList); return msg; } - login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [e395a0dd4d] (rid 199951) by jan.nijtmans on 2022-04-05 06:31:39:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2459674.77198579"
- closer changed to: "jan.nijtmans"
- comment changed to:
TclWinConvertError and TclWinConvertWSAError are private internal functions. They could be very useful to extension authors. I see a need for it. Let's make them public. Also, TclWinConvertWSAError doesn't map to all WSAE* error codes. Included are mappings to all of them. Unfortunetly, all the added can only return EINVAL until the posix codes they translate into get more meaningful to windows. Effectively, the behavior is still unchanged. Example: WSA_QOS_POLICY_FAILURE, 'rejected for administrative reasons - bad credentials' WSAEPROVIDERFAILEDINIT, 'The requested service provider could not be loaded or initialized' What posix codes do those get? Some detective work needs to be done with these. I really don't have a clue. The main reason I want to enlargen the mappings is to include WSAHOST_NOT_FOUND. I hate that the [socket] command can only return 'invalid argument' instead of 'authoritative host not found' or 'try again', or .... Should this really be a TIP?
- icomment:
Done: [https://core.tcl-lang.org/tips/doc/trunk/tip/598.md]
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- severity changed to: "Minor"
- status changed to: "Closed"