瀏覽代碼

clean error message

moritan 9 年之前
父節點
當前提交
404560fbb8
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. 3
    3
      searx/rest-server.py

+ 3
- 3
searx/rest-server.py 查看文件

@@ -10,17 +10,17 @@ from searx.version import VERSION_STRING
10 10
 from searx.languages import language_codes
11 11
 from searx.plugins import plugins
12 12
 
13
-app = Flask(__name__, static_url_path="")
13
+app = Flask(__name__, static_url_path="/static/themes/ember")
14 14
 
15 15
 
16 16
 @app.errorhandler(400)
17 17
 def not_found(error):
18
-    return make_response(jsonify({'msg': 'Bad request', 'error': error}), 400)
18
+    return make_response(jsonify({'name': error.name, 'description': error.description}), 400)
19 19
 
20 20
 
21 21
 @app.errorhandler(404)
22 22
 def not_found(error):
23
-    return make_response(jsonify({'msg': 'Not found', 'error': error}), 404)
23
+    return make_response(jsonify({'name': error.name, 'description': error.description}), 404)
24 24
 
25 25
 
26 26
 @app.route('/api/v1.0/search', methods=['GET', 'POST'])