自动抛出异常:abort(状态码)
捕获异常处理:errorhandler(状态码),定义的函数中要包含一个参数,用于接收异常信息
@blue.route('/make_abort/') def get_abort(): abort(400) return '终止'
@blue.errorhandler(400) def handler(exception): return '捕获到异常信息:%s' % exception