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

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.

主站蜘蛛池模板: 靖边县| 瑞昌市| 大丰市| 新丰县| 清丰县| 黄大仙区| 江口县| 大余县| 湘西| 济阳县| 阿合奇县| 上饶县| 庄浪县| 宣城市| 名山县| 白城市| 吉木萨尔县| 凯里市| 深州市| 柳州市| 黎平县| 贵港市| 柳江县| 松滋市| 丰顺县| 商南县| 乐东| 林甸县| 响水县| 安吉县| 浠水县| 南投县| 普宁市| 海盐县| 皮山县| 宜黄县| 稷山县| 盐池县| 个旧市| 平原县| 环江|