bugfix
This commit is contained in:
parent
e83ed1ffde
commit
f0bf17a72c
@ -88,18 +88,18 @@ from .serverenv import ServerEnv
|
|||||||
def server_error(errcode):
|
def server_error(errcode):
|
||||||
exceptions = {
|
exceptions = {
|
||||||
400: HTTPBadRequest,
|
400: HTTPBadRequest,
|
||||||
401: HTTPUnauthorized,
|
401: HTTPUnauthorized,
|
||||||
403: HTTPForbidden,
|
403: HTTPForbidden,
|
||||||
404: HTTPNotFound,
|
404: HTTPNotFound,
|
||||||
405: HTTPMethodNotAllowed,
|
405: HTTPMethodNotAllowed,
|
||||||
408: HTTPRequestTimeout,
|
408: HTTPRequestTimeout,
|
||||||
409: HTTPConflict,
|
409: HTTPConflict,
|
||||||
410: HTTPGone,
|
410: HTTPGone,
|
||||||
415: HTTPUnsupportedMediaType,
|
415: HTTPUnsupportedMediaType,
|
||||||
429: HTTPTooManyRequests,
|
429: HTTPTooManyRequests,
|
||||||
500: HTTPInternalServerError,
|
500: HTTPInternalServerError,
|
||||||
502: HTTPBadGateway,
|
502: HTTPBadGateway,
|
||||||
503: HTTPServiceUnavailable
|
503: HTTPServiceUnavailable
|
||||||
}
|
}
|
||||||
E = exceptions.get(errcode, HTTPException)
|
E = exceptions.get(errcode, HTTPException)
|
||||||
raise E()
|
raise E()
|
||||||
@ -349,8 +349,8 @@ def initEnv():
|
|||||||
g.openai_403 = openai_403
|
g.openai_403 = openai_403
|
||||||
g.openai_400 = openai_400
|
g.openai_400 = openai_400
|
||||||
g.openai_429 = openai_429
|
g.openai_429 = openai_429
|
||||||
g.timestampAdd = timestampAdd
|
g.timestampAdd = timestampAdd
|
||||||
g.timestampSub = timestampSub
|
g.timestampSub = timestampSub
|
||||||
|
|
||||||
def web_rootpath():
|
def web_rootpath():
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user