Implement job queue for asynchronous NLP #6
@@ -16,7 +16,7 @@ from flask_jwt_extended import (
|
|||||||
|
|
||||||
from server.analysis.stat_gen import StatGen
|
from server.analysis.stat_gen import StatGen
|
||||||
from server.analysis.enrichment import DatasetEnrichment
|
from server.analysis.enrichment import DatasetEnrichment
|
||||||
from server.exceptions import NotAuthorisedException, NotExistentDatasetException
|
from server.exceptions import NotAuthorisedException, NonExistentDatasetException
|
||||||
from server.db.database import PostgresConnector
|
from server.db.database import PostgresConnector
|
||||||
from server.core.auth import AuthManager
|
from server.core.auth import AuthManager
|
||||||
from server.core.datasets import DatasetManager
|
from server.core.datasets import DatasetManager
|
||||||
@@ -162,7 +162,7 @@ def get_dataset(dataset_id):
|
|||||||
return jsonify(filtered_dataset), 200
|
return jsonify(filtered_dataset), 200
|
||||||
except NotAuthorisedException:
|
except NotAuthorisedException:
|
||||||
return jsonify({"error": "User is not authorised to access this content"}), 403
|
return jsonify({"error": "User is not authorised to access this content"}), 403
|
||||||
except NotExistentDatasetException:
|
except NonExistentDatasetException:
|
||||||
return jsonify({"error": "Dataset does not exist"}), 404
|
return jsonify({"error": "Dataset does not exist"}), 404
|
||||||
except Exception:
|
except Exception:
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class NotAuthorisedException(Exception):
|
class NotAuthorisedException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class NotExistentDatasetException(Exception):
|
class NonExistentDatasetException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class DatabaseNotConfiguredException(Exception):
|
class DatabaseNotConfiguredException(Exception):
|
||||||
|
|||||||
Reference in New Issue
Block a user