MCPcopy
hub / github.com/Anionex/banana-slides / error_response

Function error_response

backend/utils/response.py:31–49  ·  view source on GitHub ↗

Generate an error response Args: error_code: Error code identifier message: Error message status_code: HTTP status code Returns: Flask response with JSON format

(error_code: str, message: str, status_code: int = 400)

Source from the content-addressed store, hash-verified

29
30
31def error_response(error_code: str, message: str, status_code: int = 400):
32 """
33 Generate an error response
34
35 Args:
36 error_code: Error code identifier
37 message: Error message
38 status_code: HTTP status code
39
40 Returns:
41 Flask response with JSON format
42 """
43 return jsonify({
44 "success": False,
45 "error": {
46 "code": error_code,
47 "message": message
48 }
49 }), status_code
50
51
52# Common error responses

Callers 15

_handle_material_uploadFunction · 0.90
generate_material_imageFunction · 0.90
list_materialsFunction · 0.90
list_all_materialsFunction · 0.90
delete_materialFunction · 0.90
download_materials_zipFunction · 0.90
list_projectsFunction · 0.90
create_projectFunction · 0.90
get_projectFunction · 0.90
update_projectFunction · 0.90
delete_projectFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected