Skip to content

Commit

Permalink
update to return single job or record error
Browse files Browse the repository at this point in the history
  • Loading branch information
rshewitt committed Jun 4, 2024
1 parent 8baa216 commit 6e745b6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,17 @@ def get_all_harvest_record_errors(record_id: str) -> list:
return "Please provide correct record_id"


@mod.route("/harvest_record/<error_id>/error", methods=["GET"])
@mod.route("/harvest_error/<error_id>", methods=["GET"])
def get_harvest_record_error(error_id: str) -> dict:
# retrieves the given error ( either job or record )
try:
job_error = db.get_harvest_job_error(error_id)
if job_error:
return job_error
record_error = db.get_harvest_record_error(error_id)
return record_error if record_error else ("Not Found", 404)
if record_error:
return record_error
return ("Not Found", 404)
except Exception:
return "Please provide correct record_id and record_error_id"

Expand Down

1 comment on commit 6e745b6

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests Skipped Failures Errors Time
2 0 💤 0 ❌ 0 🔥 8.158s ⏱️

Please sign in to comment.