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

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.

主站蜘蛛池模板: 沂水县| 伊宁县| 邓州市| 吉木萨尔县| 海阳市| 原阳县| 凤台县| 交城县| 绥棱县| 万全县| 城市| 徐水县| 吉林市| 清水县| 紫金县| 伊金霍洛旗| 海盐县| 陆丰市| 甘南县| 临高县| 灌南县| 太仓市| 铜梁县| 金堂县| 桐梓县| 麻栗坡县| 泗阳县| 偃师市| 金华市| 文化| 台前县| 保德县| 石台县| 收藏| 衡山县| 韶关市| 五河县| 札达县| 武夷山市| 拉萨市| 山西省|