Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show associated error message in job info if status is 'error' for a OTF list request #574

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/models/pydantic/user_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

class UserJob(BaseModel):
job_id: UUID
job_link: Optional[str]
status: str = "pending"
job_link: Optional[str] # Full URL to check the job status
status: str = "pending" # Can be pending, success, partial_success, failure, and error
message: Optional[str] # Error message when status is "error"
download_link: Optional[str] = None
failed_geometries_link: Optional[str] = None
progress: Optional[str] = "0%"
Expand Down
3 changes: 2 additions & 1 deletion app/routes/jobs/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ async def _get_user_job(job_id: UUID) -> UserJob:
logger.error(f"Analysis service returned an unexpected response: {output}")
return UserJob(
job_id=job_id,
status="failed",
status="error",
message=output["message"],
download_link=None,
failed_geometries_link=None,
progress="0%",
Expand Down
Loading