Comments (6)
详细描述问题的 po 主事鉴
from maimaidx-prober.
正常的话应该不放过任何一个可能的 err
返回,然后尽量在最上层集中处理错误(因为这个简单场景其实不需要专门关心、单独处理每一条路径可能的每一种错误),基本就是接住之后触发重试即可。如果担心 panic 那么也总是可以套一层 goroutine 然后 defer
块里 recover()
检查并同样触发重试。
也就是写 Go 可以方便地静默无视错误了。比方说 Rust 的错误处理你要么写 ?
(这意味着你会把 Err
抛到上一层)要么 unwrap()
(这会十分扎眼,并且很明显每处这种地方,万一确实错误了进程就会崩溃)。总之要说国服 maimai NET 是错误处理的试金石也没什么问题
from maimaidx-prober.
学到虚脱
from maimaidx-prober.
通过git bash运行得到相关报错信息:
$ ./maimaidx-prober-proxy-windows-amd64-1.3.0.exe
2023/07/03 14:53:53 INFO: 您使用的是最新版本。
2023/07/03 14:53:53 INFO: 登录成功
2023/07/03 14:53:53 INFO: 使用此软件则表示您同意共享您在微信公众号舞萌 DX、中二节奏中的数据。
2023/07/03 14:53:53 INFO: 您可以在微信客户端访问微信公众号舞萌 DX、中二节奏的个人信息主页进行分数导入,如需退出请直接关闭程序或按下 Ctrl + C
2023/07/03 14:53:53 INFO: 代理设置已自动修改。
2023/07/03 14:53:53 INFO: 代理已开启到 127.0.0.1:8033
2023/07/03 14:53:58 INFO: 正在导入 Basic 难度……
2023/07/03 14:54:00 INFO: 导入成功
2023/07/03 14:54:00 INFO: 正在导入 Advanced 难度……
2023/07/03 14:54:03 INFO: 导入成功
2023/07/03 14:54:03 INFO: 正在导入 Expert 难度……
2023/07/03 14:54:16 [007] WARN: Error copying to client: readfrom tcp 10.32.19.234:6787->202.89.233.100:443: read tcp 127.0.0.1:8033->127.0.0.1:6786: wsarecv: An existing connection was forcibly closed by the remote host.
2023/07/03 14:54:16 [007] WARN: Error copying to client: readfrom tcp 127.0.0.1:8033->127.0.0.1:6786: write tcp 127.0.0.1:8033->127.0.0.1:6786: wsasend: An existing connection was forcibly closed by the remote host.
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x40 pc=0xe003e6]
goroutine 32 [running]:
main.(*proberAPIClient).commit(0xc000086180, {0xc00066c000, 0xf47ae, 0x110000})
github.com/Diving-Fish/maimaidx-prober/proxy/cmd/maimaidx-prober-proxy/prober_api.go:54 +0xc6
main.(*proberAPIClient).fetchDataMaimai(0xc000086180, 0xc00025c500, {0xc00000a008, 0x1, 0x1})
github.com/Diving-Fish/maimaidx-prober/proxy/cmd/maimaidx-prober-proxy/prober_api.go:98 +0x679
created by main.(*proxyContext).handleResponse
github.com/Diving-Fish/maimaidx-prober/proxy/cmd/maimaidx-prober-proxy/proxy.go:51 +0x5ef
from maimaidx-prober.
看来还是要整理下代码把错误处理弄一起……有点一坨了
from maimaidx-prober.
panic位置:
前面其实已经出问题了:
maimaidx-prober/proxy/cmd/maimaidx-prober-proxy/prober_api.go
Lines 82 to 83 in e59c669
net/http: TLS handshake timeout
然而,错误判断却写在了它后面:
maimaidx-prober/proxy/cmd/maimaidx-prober-proxy/prober_api.go
Lines 87 to 89 in e59c669
当然,由于华立服务器很不稳定,每一次错误的位置和种类也不一定一样……
都来体验一下土豆服务器的快乐吧
from maimaidx-prober.
Related Issues (20)
- macOS 报错:WARN: Cannot handshake client maimai.wahlap.com:443 EOF HOT 2
- 希望网站可以算一个里Rating HOT 2
- 中二版本更新
- 是否可以添加一个 给每首歌增加标签的功能
- [Bug]使用传分token HTTP返回400但传分仍然成功 HOT 3
- 中二查分器FullChain覆盖AJ/FC标记问题
- 查分器网站与查分API无法访问
- 中二11.22更新歌曲无数据
- proxy1.3.3上传的达成率只剩下一位小数,后边三位固定000? HOT 3
- 查分器网站,rating计算器计算结果错误 HOT 2
- 乐曲等级错误,定数5.8的谱面不应为5+
- 中二节奏`music_data.json`中的乐曲标题与HTML中的不一致,导致分数导入失败 HOT 3
- 希望调整暗色主题下Ultima按钮式样
- 高级设置使用问题
- [bug] "DX Rating"列popup的渲染逻辑问题
- 部分乐曲谱面数据不正确
- config文件设置slice=true会漏掉DX2024版本的数据导入
- 中二8.8更新无数据
- rating后续分数线显示问题
- 使用方法2导入数据:不同难度下的曲目
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maimaidx-prober.