mirror of
https://github.com/NovaOSS/nova-api.git
synced 2024-11-29 13:43:56 +01:00
14 lines
370 B
Python
14 lines
370 B
Python
|
import json
|
||
|
import starlette
|
||
|
|
||
|
def error(code: int, message: str, tip: str) -> starlette.responses.Response:
|
||
|
info = {'error': {
|
||
|
'code': code,
|
||
|
'message': message,
|
||
|
'tip': tip,
|
||
|
'website': 'https://nova-oss.com',
|
||
|
'by': 'NovaOSS/Nova-API'
|
||
|
}}
|
||
|
|
||
|
return starlette.responses.Response(status_code=code, content=json.dumps(info))
|