try flask_restful -> flask_restx (#24310)
Signed-off-by: -LAN- <laipz8200@outlook.com> Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
@@ -3,13 +3,19 @@ import sys
|
||||
from typing import Any
|
||||
|
||||
from flask import current_app, got_request_exception
|
||||
from flask_restful import Api, http_status_message
|
||||
from flask_restx import Api
|
||||
from werkzeug.datastructures import Headers
|
||||
from werkzeug.exceptions import HTTPException
|
||||
from werkzeug.http import HTTP_STATUS_CODES
|
||||
|
||||
from core.errors.error import AppInvokeQuotaExceededError
|
||||
|
||||
|
||||
def http_status_message(code):
|
||||
"""Maps an HTTP status code to the textual status"""
|
||||
return HTTP_STATUS_CODES.get(code, "")
|
||||
|
||||
|
||||
class ExternalApi(Api):
|
||||
def handle_error(self, e):
|
||||
"""Error handler for the API transforms a raised exception into a Flask
|
||||
|
Reference in New Issue
Block a user