unit WinInetErrors; interface uses SysUtils; //+----------------------------------------------------------------------------+ var //---INTERNET_ERROR_BASE = 12000; WinInetErrorDescript:array [1..57]of string = ( 'ERROR_INTERNET_OUT_OF_HANDLES', 'ERROR_INTERNET_TIMEOUT', 'ERROR_INTERNET_EXTENDED_ERROR', 'ERROR_INTERNET_INTERNAL_ERROR', 'ERROR_INTERNET_INVALID_URL', 'ERROR_INTERNET_UNRECOGNIZED_SCHEME', 'ERROR_INTERNET_NAME_NOT_RESOLVED', 'ERROR_INTERNET_PROTOCOL_NOT_FOUND', 'ERROR_INTERNET_INVALID_OPTION', 'ERROR_INTERNET_BAD_OPTION_LENGTH', 'ERROR_INTERNET_OPTION_NOT_SETTABLE', 'ERROR_INTERNET_SHUTDOWN', 'ERROR_INTERNET_INCORRECT_USER_NAME', 'ERROR_INTERNET_INCORRECT_PASSWORD', 'ERROR_INTERNET_LOGIN_FAILURE', 'ERROR_INTERNET_INVALID_OPERATION', 'ERROR_INTERNET_OPERATION_CANCELLED', 'ERROR_INTERNET_INCORRECT_HANDLE_TYPE', 'ERROR_INTERNET_INCORRECT_HANDLE_STATE', 'ERROR_INTERNET_NOT_PROXY_REQUEST', 'ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND', 'ERROR_INTERNET_BAD_REGISTRY_PARAMETER', 'ERROR_INTERNET_NO_DIRECT_ACCESS', 'ERROR_INTERNET_NO_CONTEXT', 'ERROR_INTERNET_NO_CALLBACK', 'ERROR_INTERNET_REQUEST_PENDING', 'ERROR_INTERNET_INCORRECT_FORMAT', 'ERROR_INTERNET_ITEM_NOT_FOUND', 'ERROR_INTERNET_CANNOT_CONNECT', 'ERROR_INTERNET_CONNECTION_ABORTED', 'ERROR_INTERNET_CONNECTION_RESET', 'ERROR_INTERNET_FORCE_RETRY', 'ERROR_INTERNET_INVALID_PROXY_REQUEST', '', '', 'ERROR_INTERNET_HANDLE_EXISTS', 'ERROR_INTERNET_SEC_CERT_DATE_INVALID', 'ERROR_INTERNET_SEC_CERT_CN_INVALID', 'ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR', 'ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR', 'ERROR_INTERNET_MIXED_SECURITY', 'ERROR_INTERNET_CHG_POST_IS_NON_SECURE', 'ERROR_INTERNET_POST_IS_NON_SECURE', 'ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED', 'ERROR_INTERNET_INVALID_CA', 'ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP', 'ERROR_INTERNET_ASYNC_THREAD_FAILED', 'ERROR_INTERNET_REDIRECT_SCHEME_CHANGE', 'ERROR_INTERNET_DIALOG_PENDING', 'ERROR_INTERNET_RETRY_DIALOG', '', 'ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR', 'ERROR_INTERNET_INSERT_CDROM', 'ERROR_INTERNET_FORTEZZA_LOGIN_NEEDED', 'ERROR_INTERNET_SEC_CERT_ERRORS', 'ERROR_INTERNET_SEC_CERT_NO_REV', 'ERROR_INTERNET_SEC_CERT_REV_FAILED' ); //--- INTERNET_ERROR_BASE : 12000 + 150 WinHttpErrorDescript:array [0..21] of string=( 'ERROR_HTTP_HEADER_NOT_FOUND', 'ERROR_HTTP_DOWNLEVEL_SERVER', 'ERROR_HTTP_INVALID_SERVER_RESPONSE', 'ERROR_HTTP_INVALID_HEADER', 'ERROR_HTTP_INVALID_QUERY_REQUEST', 'ERROR_HTTP_HEADER_ALREADY_EXISTS', 'ERROR_HTTP_REDIRECT_FAILED', 'ERROR_INTERNET_SECURITY_CHANNEL_ERROR', 'ERROR_INTERNET_UNABLE_TO_CACHE_FILE', 'ERROR_INTERNET_TCPIP_NOT_INSTALLED', 'ERROR_HTTP_NOT_REDIRECTED', 'ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION', 'ERROR_HTTP_COOKIE_DECLINED', 'ERROR_INTERNET_DISCONNECTED', 'ERROR_INTERNET_SERVER_UNREACHABLE', 'ERROR_INTERNET_PROXY_SERVER_UNREACHABLE', 'ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT', 'ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT', 'ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION', 'ERROR_INTERNET_SEC_INVALID_CERT', 'ERROR_INTERNET_SEC_CERT_REVOKED', 'ERROR_INTERNET_FAILED_DUETOSECURITYCHECK' ); //+----------------------------------------------------------------------------+ function TcpErrorDescription(err:Integer):string; function InetErrorDescription(err:Integer):string; function HttpRetCodeDescription(errCode:Integer):string; //+----------------------------------------------------------------------------+ implementation //+----------------------------------------------------------------------------+ function InetErrorDescription(err:Integer):string; begin if(err > 12000)and(err < 12058)then Result:=WinInetErrorDescript[err-12000] else if(err >= 12150)and(err < 12172)then Result:=WinHttpErrorDescript[err-12150] else Result:=SysErrorMessage(err); if(Result='')then Result:='UNKNOWN ERROR'; end; //+----------------------------------------------------------------------------+ function TcpErrorDescription(err:Integer):string; begin case err of 10004 : Result:=' Interrupted function call.'; 10013 : Result:=' Permission denied.'; 10014 : Result:=' Bad address.'; 10022 : Result:=' Invalid argument.'; 10024 : Result:=' Too many open files. Actually, it"s too many open sockets.'; 10035 : Result:=' Resource temporarily unavailable.'; 10036 : Result:=' Operation now in progress. A blocking operation is in progress.'; 10037 : Result:=' Operation already in progress.'; 10038 : Result:=' Socket operation on non-socket.'; 10039 : Result:=' Destination address required.'; 10040 : Result:=' Message too long.'; 10041 : Result:=' Protocol wrong type for socket.'; 10042 : Result:=' Bad protocol option.'; 10043 : Result:=' Protocol not supported.'; 10044 : Result:=' Socket type not supported.'; 10045 : Result:=' Operation not supported.'; 10046 : Result:=' Protocol family not supported.'; 10047 : Result:=' Address family not supported by protocol family.'; 10048 : Result:=' Address is already in use. If you attempt to set up a server on a port that is already is in use, you will get this error.'; 10049 : Result:=' Cannot assign requested address.'; 10050 : Result:=' Network is down.'; 10051 : Result:=' Network is unreachable.'; 10052 : Result:=' Network dropped connection on reset.'; 10053 : Result:=' Software caused the connection to abort. A connection that has been made was aborted, usually due to connection or protocol error.'; 10054 : Result:=' Connection reset by peer. This occurs when an established connection is shut down for some reason by the remote computer.'; 10055 : Result:=' No buffer space available.'; 10056 : Result:=' Socket is already connected.'; 10057 : Result:=' Socket is not connected.'; 10058 : Result:=' Cannot send after socket shutdown.'; 10060 : Result:=' Connection timed out.'; 10061 : Result:=' Connection refused. You will usually see this error when a server refuses a connection from a client, because the server is not listening on that port.'; 10064 : Result:=' Host is down.'; 10065 : Result:=' No route to host.'; 10067 : Result:=' Too many processes.'; 10091 : Result:=' Network subsystem is unavailable.'; 10092 : Result:=' Unsupported version of WINSOCK.DLL.'; 10093 : Result:=' Successful WSAStartup not yet performed. TCP networking has not been initialized on your computer.'; 10094 : Result:=' Graceful shutdown in progress.'; 11001 : Result:=' Host not found. (DNS error.)'; 11002 : Result:=' Non-authoritative host not found. Temporary DNS error.'; 11003 : Result:=' Non-recoverable error. (DNS error.)'; 11004 : Result:=' Valid name, no data record of requested type. (DNS error).'; else Result:=' Unknown TCP Error.'; end; end; //+----------------------------------------------------------------------------+ function HttpRetCodeDescription(errCode:Integer):string; begin case errCode of 100 : Result:= 'Continue'; 101 : Result:= 'Switching Protocols'; 102 : Result:= 'Processing'; 103 : Result:= 'Checkpoint'; 200 : Result:= 'OK'; 201 : Result:= 'Created'; 202 : Result:= 'Accepted'; 203 : Result:= 'Non-Authoritative Information'; 204 : Result:= 'No Content'; 205 : Result:= 'Reset Content'; 206 : Result:= 'Partial Content'; 207 : Result:= 'Multi-Status'; 300 : Result:= 'Multiple Choices'; 301 : Result:= 'Moved Permanently'; 302 : Result:= 'Found'; 303 : Result:= 'See Other'; 304 : Result:= 'Not Modified'; 305 : Result:= 'Use Proxy'; 306 : Result:= 'Switch Proxy'; 307 : Result:= 'Temporary Redirect'; 400 : Result:= 'Bad Request'; 401 : Result:= 'Unauthorized'; 402 : Result:= 'Payment Required'; 403 : Result:= 'Forbidden'; 404 : Result:= 'Not Found'; 405 : Result:= 'Method Not Allowed'; 406 : Result:= 'Not Acceptable'; 407 : Result:= 'Proxy Authentication Required'; 408 : Result:= 'Request Timeout'; 409 : Result:= 'Conflict'; 410 : Result:= 'Gone'; 411 : Result:= 'Length Required'; 412 : Result:= 'Precondition Failed'; 413 : Result:= 'Request Entity Too Large'; 414 : Result:= 'Request-URI Too Long'; 415 : Result:= 'Unsupported Media Type'; 416 : Result:= 'Requested Range Not Satisfiable'; 417 : Result:= 'Expectation Failed'; 418 : Result:= 'I"m a teapot'; 422 : Result:= 'Unprocessable Entity'; 423 : Result:= 'Locked'; 424 : Result:= 'Failed Dependency'; 425 : Result:= 'Unordered Collection'; 426 : Result:= 'Upgrade Required'; 429 : Result:= 'Too Many Requests'; 449 : Result:= 'Retry With'; 450 : Result:= 'Blocked by Windows Parental Controls'; 500 : Result:= 'Internal Server Error'; 501 : Result:= 'Not Implemented'; 502 : Result:= 'Bad Gateway'; 503 : Result:= 'Service Unavailable'; 504 : Result:= 'Gateway Timeout'; 505 : Result:= 'HTTP Version Not Supported'; 506 : Result:= 'Variant Also Negotiates'; 507 : Result:= 'Insufficient Storage'; 509 : Result:= 'Bandwidth Limit Exceeded'; 510 : Result:= 'Not Extended'; else Result:='Unknown Error.'; end; end; //+----------------------------------------------------------------------------+ end.