当前位置: 首页 > 文档资料 > Swoole 中文文档 >

错误码

优质
小牛编辑
142浏览
2023-12-01

可使用swoole_last_error()获取当前的错误码;

可使用swoole_strerror(int $errno, 9);Swoole底层错误码转换成文字错误信息;

echo swoole_strerror(swoole_last_error(), 9) . PHP_EOL;
echo swoole_strerror(SWOOLE_ERROR_MALLOC_FAIL, 9) . PHP_EOL;

Linux错误码列表 :id=linux

C NameValueDescription含义
Success0Success成功
EPERM1Operation not permitted操作不允许
ENOENT2No such file or directory没有这样的文件或目录
ESRCH3No such process没有这样的过程
EINTR4Interrupted system call系统调用被中断
EIO5I/O errorI/O错误
ENXIO6No such device or address没有这样的设备或地址
E2BIG7Arg list too long参数列表太长
ENOEXEC8Exec format error执行格式错误
EBADF9Bad file number坏的文件描述符
ECHILD10No child processes没有子进程
EAGAIN11Try again资源暂时不可用
ENOMEM12Out of memory内存溢出
EACCES13Permission denied拒绝许可
EFAULT14Bad address错误的地址
ENOTBLK15Block device required块设备请求
EBUSY16Device or resource busy设备或资源忙
EEXIST17File exists文件存在
EXDEV18Cross-device link无效的交叉链接
ENODEV19No such device设备不存在
ENOTDIR20Not a directory不是一个目录
EISDIR21Is a directory是一个目录
EINVAL22Invalid argument无效的参数
ENFILE*23File table overflow打开太多的文件系统
EMFILE24Too many open files打开的文件过多
ENOTTY25Not a tty device不是tty设备
ETXTBSY26Text file busy文本文件忙
EFBIG27File too large文件太大
ENOSPC28No space left on device设备上没有空间
ESPIPE29Illegal seek非法移位
EROFS30Read-only file system只读文件系统
EMLINK31Too many links太多的链接
EPIPE32Broken pipe管道破裂
EDOM33Math argument out of domain数值结果超出范围
ERANGE34Math result not representable数值结果不具代表性
EDEADLK35Resource deadlock would occur资源死锁错误
ENAMETOOLONG36Filename too long文件名太长
ENOLCK37No record locks available没有可用锁
ENOSYS38Function not implemented功能没有实现
ENOTEMPTY39Directory not empty目录不空
ELOOP40Too many symbolic links encountered符号链接层次太多
EWOULDBLOCK41Same as EAGAIN和EAGAIN一样
ENOMSG42No message of desired type没有期望类型的消息
EIDRM43Identifier removed标识符删除
ECHRNG44Channel number out of range频道数目超出范围
EL2NSYNC45Level 2 not synchronized2级不同步
EL3HLT46Level 3 halted3级中断
EL3RST47Level 3 reset3级复位
ELNRNG48Link number out of range链接数超出范围
EUNATCH49Protocol driver not attached协议驱动程序没有连接
ENOCSI50No CSI structure available没有可用CSI结构
EL2HLT51Level 2 halted2级中断
EBADE52Invalid exchange无效的交换
EBADR53Invalid request descriptor请求描述符无效
EXFULL54Exchange full交换全
ENOANO55No anode没有阳极
EBADRQC56Invalid request code无效的请求代码
EBADSLT57Invalid slot无效的槽
EDEADLOCK58Same as EDEADLK和EDEADLK一样
EBFONT59Bad font file format错误的字体文件格式
ENOSTR60Device not a stream设备不是字符流
ENODATA61No data available无可用数据
ETIME62Timer expired计时器过期
ENOSR63Out of streams resources流资源溢出
ENONET64Machine is not on the network机器不上网
ENOPKG65Package not installed没有安装软件包
EREMOTE66Object is remote对象是远程的
ENOLINK67Link has been severed联系被切断
EADV68Advertise error广告的错误
ESRMNT69Srmount errorsrmount错误
ECOMM70Communication error on send发送时的通讯错误
EPROTO71Protocol error协议错误
EMULTIHOP72Multihop attempted多跳尝试
EDOTDOT73RFS specific errorRFS特定的错误
EBADMSG74Not a data message非数据消息
EOVERFLOW75Value too large for defined data type值太大,对于定义数据类型
ENOTUNIQ76Name not unique on network名不是唯一的网络
EBADFD77File descriptor in bad state文件描述符在坏状态
EREMCHG78Remote address changed远程地址改变了
ELIBACC79Cannot access a needed shared library无法访问必要的共享库
ELIBBAD80Accessing a corrupted shared library访问损坏的共享库
ELIBSCN81A .lib section in an .out is corrupted库段. out损坏
ELIBMAX82Linking in too many shared libraries试图链接太多的共享库
ELIBEXEC83Cannot exec a shared library directly不能直接执行一个共享库
EILSEQ84Illegal byte sequence无效的或不完整的多字节或宽字符
ERESTART85Interrupted system call should be restarted应该重新启动中断的系统调用
ESTRPIPE86Streams pipe error流管错误
EUSERS87Too many users用户太多
ENOTSOCK88Socket operation on non-socket套接字操作在非套接字上
EDESTADDRREQ89Destination address required需要目标地址
EMSGSIZE90Message too long消息太长
EPROTOTYPE91Protocol wrong type for socketsocket协议类型错误
ENOPROTOOPT92Protocol not available协议不可用
EPROTONOSUPPORT93Protocol not supported不支持的协议
ESOCKTNOSUPPORT94Socket type not supported套接字类型不受支持
EOPNOTSUPP95Operation not supported on transport不支持的操作
EPFNOSUPPORT96Protocol family not supported不支持的协议族
EAFNOSUPPORT97Address family not supported by protocol协议不支持的地址
EADDRINUSE98Address already in use地址已在使用
EADDRNOTAVAIL99Cannot assign requested address无法分配请求的地址
ENETDOWN100Network is down网络瘫痪
ENETUNREACH101Network is unreachable网络不可达
ENETRESET102Network dropped网络连接丢失
ECONNABORTED103Software caused connection软件导致连接中断
ECONNRESET104Connection reset by连接被重置
ENOBUFS105No buffer space available没有可用的缓冲空间
EISCONN106Transport endpoint传输端点已经连接
ENOTCONN107Transport endpoint传输终点没有连接
ESHUTDOWN108Cannot send after transport传输后无法发送
ETOOMANYREFS109Too many references太多的参考
ETIMEDOUT110Connection timed连接超时
ECONNREFUSED111Connection refused拒绝连接
EHOSTDOWN112Host is down主机已关闭
EHOSTUNREACH113No route to host没有主机的路由
EALREADY114Operation already已运行
EINPROGRESS115Operation now in正在运行
ESTALE116Stale NFS file handle陈旧的NFS文件句柄
EUCLEAN117Structure needs cleaning结构需要清洗
ENOTNAM118Not a XENIX-named不是XENIX命名的
ENAVAIL119No XENIX semaphores没有XENIX信号量
EISNAM120Is a named type file是一个命名的文件类型
EREMOTEIO121Remote I/O error远程输入/输出错误
EDQUOT122Quota exceeded超出磁盘配额
ENOMEDIUM123No medium found没有磁盘被发现
EMEDIUMTYPE124Wrong medium type错误的媒体类型
ECANCELED125Operation Canceled取消操作
ENOKEY126Required key not available所需键不可用
EKEYEXPIRED127Key has expired关键已过期
EKEYREVOKED128Key has been revoked关键被撤销
EKEYREJECTED129Key was rejected by service关键被拒绝服务
EOWNERDEAD130Owner died所有者死亡
ENOTRECOVERABLE131State not recoverable状态不可恢复
ERFKILL132Operation not possible due to RF-kill由于RF-kill而无法操作

Swoole错误码列表 :id=swoole

Constants NameValueDescription含义
SWOOLE_ERROR_MALLOC_FAIL501malloc fail
SWOOLE_ERROR_SYSTEM_CALL_FAIL502system call fail
SWOOLE_ERROR_PHP_FATAL_ERROR503php fatal error
SWOOLE_ERROR_NAME_TOO_LONG504name too long
SWOOLE_ERROR_INVALID_PARAMS505invalid params
SWOOLE_ERROR_QUEUE_FULL506queue full
-
SWOOLE_ERROR_FILE_NOT_EXIST700file not exist
SWOOLE_ERROR_FILE_TOO_LARGE701file too large
SWOOLE_ERROR_FILE_EMPTY702file empty
SWOOLE_ERROR_DNSLOOKUP_DUPLICATE_REQUEST703dnslookup duplicate request
SWOOLE_ERROR_DNSLOOKUP_RESOLVE_FAILED704dnslookup resolve failed
SWOOLE_ERROR_DNSLOOKUP_RESOLVE_TIMEOUT705dnslookup resolve timeout
SWOOLE_ERROR_BAD_IPV6_ADDRESS706bad ipv6 address
SWOOLE_ERROR_UNREGISTERED_SIGNAL707unregistered signal
-
SWOOLE_ERROR_SESSION_CLOSED_BY_SERVER1001session closed by server
SWOOLE_ERROR_SESSION_CLOSED_BY_CLIENT1002session closed by client
SWOOLE_ERROR_SESSION_CLOSING1003session closing
SWOOLE_ERROR_SESSION_CLOSED1004session closed
SWOOLE_ERROR_SESSION_NOT_EXIST1005session not exist
SWOOLE_ERROR_SESSION_INVALID_ID1006session invalid id
SWOOLE_ERROR_SESSION_DISCARD_TIMEOUT_DATA1007session discard timeout data
SWOOLE_ERROR_OUTPUT_BUFFER_OVERFLOW1008output buffer overflow
SWOOLE_ERROR_SSL_NOT_READY1009ssl not ready
SWOOLE_ERROR_SSL_CANNOT_USE_SENFILE1010ssl cannot use senfile
SWOOLE_ERROR_SSL_EMPTY_PEER_CERTIFICATE1011ssl empty peer certificate
SWOOLE_ERROR_SSL_VEFIRY_FAILED1012ssl vefiry failed
SWOOLE_ERROR_SSL_BAD_CLIENT1013ssl bad client
SWOOLE_ERROR_SSL_BAD_PROTOCOL1014ssl bad protocol
-
SWOOLE_ERROR_PACKAGE_LENGTH_TOO_LARGE1201package length too large
SWOOLE_ERROR_DATA_LENGTH_TOO_LARGE1202data length too large
-
SWOOLE_ERROR_TASK_PACKAGE_TOO_BIG2001task package too big
SWOOLE_ERROR_TASK_DISPATCH_FAIL2002task dispatch fail
-
SWOOLE_ERROR_HTTP2_STREAM_ID_TOO_BIG3001http2 stream id too big
SWOOLE_ERROR_HTTP2_STREAM_NO_HEADER3002http2 stream no header
SWOOLE_ERROR_HTTP2_STREAM_NOT_FOUND3003http2 stream not found
-
SWOOLE_ERROR_AIO_BAD_REQUEST4001Raio bad request
SWOOLE_ERROR_AIO_CANCELED4002aio canceled
-
SWOOLE_ERROR_CLIENT_NO_CONNECTION5001client no connection
SWOOLE_ERROR_SOCKET_CLOSED5002socket closed
SWOOLE_ERROR_SOCKS5_UNSUPPORT_VERSION7001socks5 unsupport version
SWOOLE_ERROR_SOCKS5_UNSUPPORT_METHOD7002socks5 unsupport method
SWOOLE_ERROR_SOCKS5_AUTH_FAILED7003socks5 auth failed
SWOOLE_ERROR_SOCKS5_SERVER_ERROR7004socks5 server error
-
SWOOLE_ERROR_HTTP_PROXY_HANDSHAKE_ERROR8001http proxy handshake error
SWOOLE_ERROR_HTTP_INVALID_PROTOCOL8002http invalid protocol
-
SWOOLE_ERROR_WEBSOCKET_BAD_CLIENT8501websocket bad client
SWOOLE_ERROR_WEBSOCKET_BAD_OPCODE8502websocket bad opcode
SWOOLE_ERROR_WEBSOCKET_UNCONNECTED8503websocket unconnected
SWOOLE_ERROR_WEBSOCKET_HANDSHAKE_FAILED8504websocket handshake failed
-
SWOOLE_ERROR_SERVER_MUST_CREATED_BEFORE_CLIENT9001server must created before client
SWOOLE_ERROR_SERVER_TOO_MANY_SOCKET9002server too many socket
SWOOLE_ERROR_SERVER_WORKER_TERMINATED9003server worker terminated
SWOOLE_ERROR_SERVER_INVALID_LISTEN_PORT9004server invalid listen port
SWOOLE_ERROR_SERVER_TOO_MANY_LISTEN_PORT9005server too many listen port
SWOOLE_ERROR_SERVER_PIPE_BUFFER_FULL9006server pipe buffer full
SWOOLE_ERROR_SERVER_NO_IDLE_WORKER9007server no idle worker
SWOOLE_ERROR_SERVER_ONLY_START_ONE9008server only start one
SWOOLE_ERROR_SERVER_SEND_IN_MASTER9009server send in master
SWOOLE_ERROR_SERVER_INVALID_REQUEST9010server invalid request
SWOOLE_ERROR_SERVER_WORKER_EXIT_TIMEOUT9011server worker exit timeout
-
SWOOLE_ERROR_CO_OUT_OF_COROUTINE10001coroutine out of coroutine
SWOOLE_ERROR_CO_HAS_BEEN_BOUND10002coroutine has been bound
SWOOLE_ERROR_CO_MUTEX_DOUBLE_UNLOCK10003coroutine mutex double unlock
SWOOLE_ERROR_CO_BLOCK_OBJECT_LOCKED10004coroutine block object locked
SWOOLE_ERROR_CO_BLOCK_OBJECT_WAITING10005coroutine block object waiting
SWOOLE_ERROR_CO_YIELD_FAILED10006coroutine yield failed
SWOOLE_ERROR_CO_GETCONTEXT_FAILED10007coroutine getcontext failed
SWOOLE_ERROR_CO_SWOOLEAPCONTEXT_FAILED10008coroutine swapcontext failed
SWOOLE_ERROR_CO_MAKECONTEXT_FAILED10009coroutine makecontext failed
SWOOLE_ERROR_CO_IOCPINIT_FAILED10010coroutine iocpinit failed
SWOOLE_ERROR_CO_PROTECT_STACK_FAILED10011coroutine protect stack failed
SWOOLE_ERROR_CO_STD_THREAD_LINK_ERROR10012coroutine std thread link error
SWOOLE_ERROR_CO_DISABLED_MULTI_THREAD10013coroutine disabled multi thread