Skip to content

Commit

Permalink
add problematic files to error response
Browse files Browse the repository at this point in the history
  • Loading branch information
blankdots committed Nov 3, 2022
1 parent 5d7d9ad commit ccf0a9e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion metadata_backend/api/operators/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit ccf0a9e

Please sign in to comment.