Skip to content

Commit

Permalink
Merge pull request #574 from wri/show_error_message
Browse files Browse the repository at this point in the history
Show associated error message in job info if status is 'error' for a OTF list request
  • Loading branch information
danscales authored Aug 15, 2024
2 parents e9041cf + fc18d5f commit ae83db0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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

0 comments on commit ae83db0

Please sign in to comment.