Error Code:修订间差异
Julian Yuen(留言 | 贡献) 无编辑摘要 |
Julian Yuen(留言 | 贡献) 小 →开发人员信息 |
||
第443行: | 第443行: | ||
{| | {| | ||
|- | |- | ||
| style="background: #d8e8ff;" | | | style="background: #d8e8ff;" | 代码位置: | ||
| <tt>boinc/lib/util.C const char* boincerror(int which_error)</tt>, 及<br><tt>boinc/lib/error_numbers.h</tt> | | <tt>boinc/lib/util.C const char* boincerror(int which_error)</tt>, 及<br><tt>boinc/lib/error_numbers.h</tt> | ||
|- | |- | ||
| style="background: #d8e8ff;" | | | style="background: #d8e8ff;" | 程序说明书: | ||
| [[boinc/lib/util.C]] | | [[boinc/lib/util.C]] | ||
|- | |- | ||
| style="background: #d8e8ff;" | CVS | | style="background: #d8e8ff;" | CVS 摘录: | ||
| <tt><nowiki>cvs -d :pserver:anonymous:@alien.ssl.berkeley.edu:/home/cvs/cvsroot checkout boinc/lib/util.C </nowiki></tt> | | <tt><nowiki>cvs -d :pserver:anonymous:@alien.ssl.berkeley.edu:/home/cvs/cvsroot checkout boinc/lib/util.C </nowiki></tt> | ||
<tt><nowiki>cvs -d :pserver:anonymous:@alien.ssl.berkeley.edu:/home/cvs/cvsroot checkout boinc/lib/error_numbers.h </nowiki></tt> | <tt><nowiki>cvs -d :pserver:anonymous:@alien.ssl.berkeley.edu:/home/cvs/cvsroot checkout boinc/lib/error_numbers.h </nowiki></tt> |
2008年6月9日 (一) 19:34的版本
总述
Error Codes(错误代码)是程序中的“函数”所返回的值。它被用于表示该函数的执行是成功还是失败。如果函数运行没有出现错误,则返回零值(0)。
如果函数运行出现错误,函数将返回一个不确定的值,用以显示函数出错的原因。开发人员使用这些错误代码来追踪导致出错的原因。
BOINC"官方"所用的错误代码列表被定义在文件 boinc/lib/error_numbers.h 中。当您使用BOINC的时候,可能还会遇到其他的一些错误代码。这些错误代码是由用来支持BOINC的网站与FTP软件所返回的。
BOINC 错误代码
下表列出了您在使用或编写BOINC下的程序时可能见到的错误代码。下表包含以下信息:
- 错误代码的内部名称(name)。
- 完全列出的实际数值(numeric value),因为早期版本的BOINC客户端软件常显示这类值。
- 错误信息中所显示的值。
- 错误代码的额外附加信息。
错误 "名称(name)" | 数值 | 显示的文本 | 附加的细节信息 |
---|---|---|---|
BOINC_SUCCESS | 0 | Success | |
ERR_SELECT | -100 | system select | |
ERR_MALLOC | -101 | system malloc | |
ERR_READ | -102 | system read | |
ERR_WRITE | -103 | system write | |
ERR_FREAD | -104 | system fread | |
ERR_FWRITE | -105 | system fwrite | |
ERR_IO | -106 | system I/O | 读/写磁盘失败,或在网络传输过程中传送和接受数据失败。
通常来说,与项目服务器的数据传输失败指在与服务器的传输过程中,或网路的路由重置了BOINC客户端软件与项目服务器的连接。很多种不同的原因都可能导致这种错误,比如项目服务器过载,或传输中的丢包。
|
ERR_CONNECT | -107 | system connect | 无法连接FTP服务器。 |
ERR_FOPEN | -108 | system fopen | 该文件被其它进程打开和占用,或无法对该文件进行写操作。 |
ERR_RENAME | -109 | system rename | 该文件无法被重命名。 |
ERR_UNLINK | -110 | system unlink | |
ERR_OPENDIR | -111 | system opendir | |
ERR_XML_PARSE | -112 | unexpected XML tag or syntax | 未定义的 XML 标签或 XML 格式。 |
ERR_GETHOSTBYNAME | -113 | can't resolve hostname | 无法解析主机名。 |
ERR_GIVEUP_DOWNLOAD | -114 | timeout on download | 文件传输在过长时间内未取得进展,或服务器返回了404(无法找到)状态代码。 |
ERR_GIVEUP_UPLOAD | -115 | timeout on upload | |
ERR_NULL | -116 | null pointer | 意料之外的空指针。 |
ERR_NEG | -117 | unexpected negative value | 未定义的值。 |
ERR_BUFFER_OVERFLOW | -118 | buffer overflow | 缓存溢出。 |
ERR_MD5_FAILED | -119 | md5 checksum failed for file | 某个文件的MD5验证码不符。 |
ERR_RSA_FAILED | -120 | RSA key check failed for file | 某个文件的RSA密钥验证失败。 |
ERR_OPEN | -121 | system open | |
ERR_DUP2 | -122 | system dup | |
ERR_NO_SIGNATURE | -123 | no signature | |
ERR_THREAD | -124 | creating a thread | 创建线程出错。 |
ERR_SIGNAL_CATCH | -125 | caught signal | |
ERR_UPLOAD_TRANSIENT | -127 | transient upload error | |
ERR_UPLOAD_PERMANENT | -128 | fatal upload error | |
ERR_IDLE_PERIOD | -129 | user preferences say can't start work | 因用户自定义参数而无法开始工作 |
ERR_ALREADY_ATTACHED | -130 | already attached to project | |
ERR_FILE_TOO_BIG | -131 | file size too big | 输出文件超过最大值 |
ERR_GETRUSAGE | -132 | system getrusage | getrusage failed |
ERR_BENCHMARK_FAILED | -133 | benchmark failed | |
ERR_BAD_HEX_FORMAT | -134 | hex format key data bad | 16进制密钥数据损坏。 |
ERR_USER_REJECTED | -135 | user rejected executable file | 用户拒绝的可执行文件 |
ERR_DB_NOT_FOUND | -136 | no database rows found in lookup/enumerate | 在查找lookup()或列举enumerate()中没有找到行。 |
ERR_DB_NOT_UNIQUE | -137 | database lookup not unique | 在查找lookup()中不唯一。 |
ERR_DB_CANT_CONNECT | -138 | can't connect to datbase | |
ERR_GETS | -139 | system gets/fgets | gets() or fgets() |
ERR_SCANF | -140 | system scanf/fscanf | scanf() or fscanf() |
ERR_STRCHR | -141 | system strchr | |
ERR_STRSTR | -142 | system strstr | |
ERR_READDIR | -143 | system readdir | |
ERR_SHMGET | -144 | system shmget | |
ERR_SHMCTL | -145 | system shmctl | |
ERR_SHMAT | -146 | system shmat | |
ERR_FORK | -471 | system fork | |
ERR_EXEC | -148 | system exec | |
ERR_NOT_EXITED | -149 | process didn't exit | 应该退出的进程却没有退出 |
ERR_NOT_IMPLEMENTED | -150 | system call not implemented | 一个系统调用在该平台上无法实施。 |
ERR_GETHOSTNAME | -151 | system gethostname | |
ERR_NETOPEN | -152 | system netopen | |
ERR_SOCKET | -153 | system socket | |
ERR_FCNTL | -154 | system fcntl | |
ERR_AUTHENTICATOR | -155 | authentication error | 调度器请求的主机ID与验证器不相符。 |
ERR_SCHED_SHMEM | -156 | scheduler shared memory contents bad | |
ERR_ASYNCSELECT | -157 | system async select | |
ERR_BAD_RESULT_STATE | -158 | bad result state | |
ERR_DB_CANT_INIT | -159 | can't init database | |
ERR_NOT_UNIQUE | -160 | state files have redundant entries | 状态文件有多余的条目。 |
ERR_NOT_FOUND | -161 | not found | 不一致的客户端状态 |
ERR_NO_EXIT_STATUS | -162 | no exit status in scheduler request | 调度器请求中没有找到退出状态。(调度器未请求退出状态) |
ERR_FILE_MISSING | -163 | file missing | |
ERR_NESTED_UNHANDLED_EXCEPTION_DETECTED | -164 | nested unhandled exception | |
ERR_SEMGET | -165 | system get semaphore | |
ERR_SEMCTL | -166 | system control semaphore | |
ERR_SEMOP | -167 | system op semaphore | |
ERR_FTOK | -168 | system ftok | |
ERR_SOCKS_UNKNOWN_FAILURE | -169 | socket unknown | |
ERR_SOCKS_REQUEST_FAILED | -170 | socket request | |
ERR_SOCKS_BAD_USER_PASS | -171 | socket bad user password | |
ERR_SOCKS_UNKNOWN_SERVER_VERSION | -172 | socket unknown server version | |
ERR_SOCKS_UNSUPPORTED | -173 | socket unsupported | |
ERR_SOCKS_CANT_REACH_HOST | -174 | socket can't reach host | |
ERR_SOCKS_CONN_REFUSED | -175 | socket connection refused | |
ERR_TIMER_INIT | -176 | timer init | |
ERR_RSC_LIMIT_EXCEEDED | -177 | resource limit exceeded | |
ERR_INVALID_PARAM | -178 | invalid parameter | |
ERR_SIGNAL_OP | -179 | signal op | |
ERR_BIND | -180 | system bind | |
ERR_LISTEN | -181 | system listen | |
ERR_TIMEOUT | -182 | timeout | |
ERR_PROJECT_DOWN | -183 | project down | |
ERR_HTTP_ERROR | -184 | http error | |
ERR_RESULT_START | -185 | result start | |
ERR_RESULT_DOWNLOAD | -186 | result download | |
ERR_RESULT_UPLOAD | -187 | result upload | |
ERR_INVALID_URL | -189 | invalid URL | |
ERR_MAJOR_VERSION | -190 | major version | |
ERR_NO_OPTION | -191 | no option | |
ERR_MKDIR | -192 | mkdir | |
ERR_INVALID_EVENT | -193 | invalid event | |
ERR_ALREADY_RUNNING | -194 | already running | |
ERR_NO_APP_VERSION | -195 | no app version | |
ERR_WU_USER_RULE | -196 | user already did result for this workunit | |
ERR_ABORTED_VIA_GUI | -197 | result aborted via GUI | |
ERR_INSUFFICIENT_RESOURCE | -198 | insufficient resources | |
ERR_RETRY | -199 | retry | |
ERR_WRONG_SIZE | -200 | wrong size | |
ERR_USER_PERMISSION | -201 | user permission | 比如,用户不允许网络连接。 |
ERR_SHMEM_NAME | -202 | can't get shared mem segment name | |
ERR_NO_NETWORK_CONNECTION | -203 | no available network connection | |
ERR_IN_PROGRESS | -204 | ||
ERR_BAD_EMAIL_ADDR | -205 | ||
ERR_BAD_PASSWD | -206 | ||
ERR_NONUNIQUE_EMAIL | -207 | ||
ERR_ACCT_CREATION_DISABLED | -208 | ||
ERR_ATTACH_FAIL_INIT | -209 | Couldn't start master page download | |
ERR_ATTACH_FAIL_DOWNLOAD | -210 | Couldn't download master page | |
ERR_ATTACH_FAIL_PARSE | -211 | Couldn't parse master page | |
ERR_ATTACH_FAIL_BAD_KEY | -212 | Invalid account key | |
ERR_ATTACH_FAIL_FILE_WRITE | -213 | Couldn't write account file |
网站与FTP错误代码
下面的是HTTP返回代码含义的概述。更多信息请查阅 [RFC 2616] 的第10部分 或 Fielding, et al. - 10 Status Code Definitions。 您也可以在HTTP Status Code Information获取更多深入信息。
作者应该特别注意 400 与 500 系列的代码,因为这些表明用户没能成功的访问页面。300系列的代码表示用户被跳转,所以链接可能被改变。600 系列的代码通常指该 URL 出现了问题,所以连接检测器无法理解如何来检测它。
错误代码 | 名称简写 | 意义 |
---|---|---|
1xx: Informational - These reponse codes indicate a provisional response that should be followed by another response. | ||
100 | Continue | The server has not rejected the initial part of the request, and the client should continue. |
101 | Switching Protocols | The server agrees with the client's request to change protocols. |
2xx Successful - These reponse codes indicate that the client's request was successfully received, understood, and accepted. | ||
200 | OK | The request has succeeded. |
201 | Created | The request has been fulfilled and resulted in a new resource being created. |
202 | Accepted | The request has been accepted for processing, but the processing has not been completed. |
203 | Non-Authoritative Information | The returned headers are not definitive, but are gathered from a local or a third-party copy. |
204 | No Content | The server has fulfilled the request but does not need to return any output. |
205 | Reset Content | The server has fulfilled the request and the client should reset the document view (primarily intended to make data-entry easier). |
206 | Partial Content | The server has fulfilled the partial GET request for the resource. |
3xx: Redirection - These response codes indicate that the client was redirected to another URI, or that further action needs to be taken by the user agent in order to fulfill the request. | ||
4xx: Client Errors - These response codes are intended for cases in which the client seems to have erred. | ||
400 | Bad Request | The request could not be understood by the server due to malformed syntax. The client system SHOULD NOT repeat the request without modifications. |
401 | Unauthorized | The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.47) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity might include relevant diagnostic information. HTTP access authentication is explained in "HTTP Authentication: Basic and Digest Access Authentication" (43) |
403 | Forbidden | The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead.
Typically due to file access permissions on the server. In the case of the BOINC System, the Web Server thinks that the HTTP data stream sent by the client (e.g. a Web Browser or the BOINC Daemon) was correct, but access to the resource identified by the URL is forbidden for some reason. This indicates a fundamental access problem, which may be difficult to resolve because the HTTP protocol allows the Web Server to give this response without providing any reason at all. So the 403 error is equivalent to a blanket 'NO' by the Server - with no further discussion allowed. By far the most common reason for this error is that directory browsing is forbidden for the Web Site. In the case of a response to a Scheduler Request Message or an Upload/Download action is because of an error on the server-side of BOINC System. |
404 | Not Found | Couldn't find the Web Page. The server has not found anything matching the URI/URL. |
5xx: Server Errors - These response codes indicate cases in which the server is aware that it has erred or is incapable of performing the request. | ||
500 | Internal Server Error | The Server experienced an internal error and could not process the request. |
501 | Not Implemented | The server does not support the functionality required to fulfill the request. |
502 | Bad Gateway | The server is a gateway or proxy and received an invalid response from the upstream server it accessed in attempting to fulfill the request. |
503 | Service Unavailable | The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. |
504 | Gateway Timeout | The server is a gateway or proxy and did not receive a timely response from the upstream server. |
505 | HTTP Version Not Supported | The server does not support, or refuses to support, the HTTP protocol version that was used in the request. |
6xx: Internal Errors - These response codes indicate that an error occurred in the link checking program itself (these are unofficial error codes used to report problems). |
开发人员信息
代码位置: | boinc/lib/util.C const char* boincerror(int which_error), 及 boinc/lib/error_numbers.h |
程序说明书: | boinc/lib/util.C |
CVS 摘录: | cvs -d :pserver:anonymous:@alien.ssl.berkeley.edu:/home/cvs/cvsroot checkout boinc/lib/util.C
cvs -d :pserver:anonymous:@alien.ssl.berkeley.edu:/home/cvs/cvsroot checkout boinc/lib/error_numbers.h |