xieyuschen / goreminder Goto Github PK
View Code? Open in Web Editor NEWSubscribe your favorite novels :)
Subscribe your favorite novels :)
例如邮件服务,网络请求的服务如果失败会调用panic函数,如果没有对panic进行处理那么直接导致程序错误退出。如之前因为请求错误导致的panic退出程序:
goroutine 1890 [running]:
GoReminder/WebScanner.ArticleUrlAndSubject.func1(0x0, 0xc0000101d0)
/GoReminder/WebScanner/scanner.go:19 +0x47
GoReminder/WebScanner.ArticleUrlAndSubject(0x8796fc, 0x1b, 0xc0001d66c0)
/GoReminder/WebScanner/scanner.go:39 +0xf3
created by GoReminder/Reminder.Reminder
/GoReminder/Reminder/reminder.go:34 +0x3d8
exit status 2
就属于典型的没有对panic进行恢复导致的程序崩溃。需要解决
一个好的panic一定要有recover,否则错误处理结束的调用栈会直接把整个程序给关闭掉,但实际上我想要做的事情只是把当前panic在的这个函数给结束了。
所以说代码扔到服务器上中间估计碰到一个小panic就直接结束了。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.