上QQ阅读APP看书,第一时间看更新
Errors in your code
No developer wants to admit there are bugs in their code, but if you create more than a simple chatbot, there probably will be. There are different ways to approach this problem, from writing tests for every function, to thorough end-to-end testing, to wrapping everything in a try/catch. This book will let you decide how you want to deal with these errors, but expecting your code to be error-free is a very dangerous path.
No matter how you want to stop errors getting into your code, you need to deal with them when you get them. This is where having a low-level error handler can also be of use. You can use that to catch errors that have occurred in your code the same way that you deal with errors from external APIs.