diff --git a/metadata_backend/api/operators/file.py b/metadata_backend/api/operators/file.py index d798355b4..40c729608 100644 --- a/metadata_backend/api/operators/file.py +++ b/metadata_backend/api/operators/file.py @@ -3,6 +3,7 @@ from datetime import datetime from typing import Dict, List, Optional, Tuple +import ujson from aiohttp import web from pymongo.errors import ConnectionFailure, OperationFailure @@ -235,7 +236,11 @@ async def check_submission_files_ready(self, submission_id: str) -> None: f"in the submission with id: {submission_id}" ) LOG.error(reason) - raise web.HTTPBadRequest(reason=reason) + raise web.HTTPBadRequest( + reason=reason, + text=ujson.dumps({"problematic-files": problematic_files}), + content_type="application/json", + ) LOG.debug("All files have been marked as ready") except (ConnectionFailure, OperationFailure) as error: reason = f"Error happened while getting submission, err: {error}"