This commit is contained in:
yumoqing 2025-08-20 14:27:07 +08:00
parent b5d8ab9829
commit 449dbb17ac

View File

@ -430,19 +430,20 @@ async with db.sqlorContext('dbname') as sor:
### 1.0.8 ### 1.0.8
#### server_error(errcode) #### server_error(errcode)
add a new global function named "server_error(errcode)", it will raise a HTTPException, errcode should be one of: add a new global function named "server_error(errcode)", it will raise a HTTPException, errcode should be one of:
400 aiohttp.web.HTTPBadRequest 错误请求 * 400 aiohttp.web.HTTPBadRequest 错误请求
401 aiohttp.web.HTTPUnauthorized 未认证 * 401 aiohttp.web.HTTPUnauthorized 未认证
403 aiohttp.web.HTTPForbidden 禁止访问 * 403 aiohttp.web.HTTPForbidden 禁止访问
404 aiohttp.web.HTTPNotFound 未找到 * 404 aiohttp.web.HTTPNotFound 未找到
405 aiohttp.web.HTTPMethodNotAllowed 方法不允许 * 405 aiohttp.web.HTTPMethodNotAllowed 方法不允许
408 aiohttp.web.HTTPRequestTimeout 请求超时 * 408 aiohttp.web.HTTPRequestTimeout 请求超时
409 aiohttp.web.HTTPConflict 冲突 * 409 aiohttp.web.HTTPConflict 冲突
410 aiohttp.web.HTTPGone 已删除 * 410 aiohttp.web.HTTPGone 已删除
415 aiohttp.web.HTTPUnsupportedMediaType 不支持的媒体类型 * 415 aiohttp.web.HTTPUnsupportedMediaType 不支持的媒体类型
429 aiohttp.web.HTTPTooManyRequests 请求过多 * 429 aiohttp.web.HTTPTooManyRequests 请求过多
500 aiohttp.web.HTTPInternalServerError 服务器错误 * 500 aiohttp.web.HTTPInternalServerError 服务器错误
502 aiohttp.web.HTTPBadGateway 错误网关 * 502 aiohttp.web.HTTPBadGateway 错误网关
503 aiohttp.web.HTTPServiceUnavailable 服务不可用 * 503 aiohttp.web.HTTPServiceUnavailable 服务不可用
else it will raise HTTPException exception else it will raise HTTPException exception
#### request['run_ns'] #### request['run_ns']
global environment now can access from request['run_ns'], it contains all the globals variable in ServerEnv and related variables of request global environment now can access from request['run_ns'], it contains all the globals variable in ServerEnv and related variables of request