removed usage of bottle for handling exceptions for rest api

This commit is contained in:
bharnden 2018-10-16 09:42:43 -07:00
parent 9b8f2868fd
commit 8d610c99e9
3 changed files with 9 additions and 9 deletions

View file

@ -1,9 +1,9 @@
import os
from bottle import HTTPError
from flask import Flask
from flask import jsonify
from flask import request
from werkzeug.exceptions import HTTPException
import core_utils
import emane_routes
@ -78,9 +78,9 @@ def upload():
return jsonify()
@app.errorhandler(HTTPError)
@app.errorhandler(HTTPException)
def handle_error(e):
return jsonify(message=e.body, status=e.status_code), e.status_code
return jsonify(message=e.description, status=e.code), e.code
if __name__ == "__main__":

View file

@ -2,7 +2,7 @@ import os
from functools import wraps
from threading import Lock
from bottle import abort
from werkzeug.exceptions import abort
save_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "uploads")
CORE_LOCK = Lock()