官术网_书友最值得收藏!

Error handling and debugging

When something goes wrong in your application, it's important to be able to control what responses will the clients will receive. In HTML web apps, you usually get specific HTML pages when you encounter a 404 or a 50x error, and that's how Flask works out of the box. But when building microservices, you need to have more control on what should be sent back to the client--that's where custom error handlers come in handy.

The other important feature is the ability to debug what's wrong with your code when an unexpected error occurs. And Flask comes with a built-in debugger we'll discover in this section, which can be activated when your app runs in the debug mode.

主站蜘蛛池模板: 宁远县| 浏阳市| 那坡县| 容城县| 甘谷县| 绿春县| 江西省| 博湖县| 潜山县| 沅陵县| 项城市| 西乌珠穆沁旗| 沁水县| 会昌县| 昌乐县| 县级市| 清水河县| 汤阴县| 许昌县| 桦甸市| 昌江| 武宣县| 樟树市| 开阳县| 屏山县| 兴隆县| 建湖县| 巴彦县| 富顺县| 东光县| 新龙县| 汪清县| 安福县| 大新县| 上林县| 麻栗坡县| 安图县| 平和县| 海宁市| 根河市| 大关县|