error

Rust中的错误处理

我的未来我决定 提交于 2019-11-28 12:16:00
Result & Panic 这次讲得详细,从错误的来历及简写过程, 都写明白了, 先浅,再深,先深,再浅, 反复之, 学习王道~ use std::fs::File; //use std::io::ErrorKind; fn main() { //panic!("crash and burn"); //let v = vec![1, 2, 3]; //v[99]; /* let f = File::open("hello.txt"); let f = match f { Ok(file) => file, Err(error) => match error.kind() { ErrorKind::NotFound => match File::create("hello.txt") { Ok(fc) => fc, Err(e) => panic!("Try create new file, but error : {:#?}", e), }, other_error => panic!("There was a problem opening the file: {:#?}", other_error), }, }; let f = File::open("hello.txt").map_err(|error| { if error.kind() == ErrorKind:

Django 运行 runserver 端口占用,报错:Errno 10013

允我心安 提交于 2019-11-28 10:37:17
来源: http://www.markjour.com/article/django-runserver-error.html 运行 django runserver 的时候,出现 Error 10013,即 8000 端口被占用。 使用 apache wsgi 也是说端口占用。 不想换端口,有一段快捷方式在浏览器上呢,所以需要找出那个占用端口的进程,然后卸掉。 1、查看所有的端口占用情况 C:\Users\Administrator\>netstat -ano 活动连接 协议 本地地址 外部地址 状态 PID TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 764 TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4 TCP 0.0.0.0:1718 0.0.0.0:0 LISTENING 392 TCP 0.0.0.0:2425 0.0.0.0:0 LISTENING 248 TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING 9416 TCP 0.0.0.0:3690 0.0.0.0:0 LISTENING 2620 TCP 0.0.0.0:8000 0.0.0.0:0 LISTENING 3108 TCP 0.0.0.0:11211 0.0.0.0:0 LISTENING 1708 TCP 0.0.0.0

解决nginx: [error] open() \"/usr/local/nginx/logs/nginx.pid\" failed (2: No such file or directory)错误

岁酱吖の 提交于 2019-11-28 05:12:05
服务器重启后,重启nginx时报错nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory),进入到logs目录发现确实没有nginx.pid文件 cd /usr/local/nginx/sbin/ ./nginx -s reload ngx_http_fastdfs_set pid=1412 ngx_http_fastdfs_set pid=1412 ngx_http_fastdfs_set pid=1412 ngx_http_fastdfs_set pid=1412 nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory) 解决办法 使用指定nginx.conf文件的方式重启nginx /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 此时去logs目录下查看发现nginx.pid文件已经生成了 来源: https://www.cnblogs.com/chengfengchi/p/11393372.html