Skip to content

Commit

Permalink
Merge pull request #12 from k4rimDev/Bug
Browse files Browse the repository at this point in the history
🔨 Fix task
  • Loading branch information
k4rimDev authored Mar 7, 2024
2 parents eef1d37 + a4c61da commit a4bffad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/routers/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def task_your_ip(Authorize: AuthJWT = Depends()):
task = create_ip_address_task.delay(current_user, ip_address)
return {"task_id": task.id}
except Exception as e:
raise HTTPException(status_code=500, detail="Task failed to create") from e
raise HTTPException(
status_code=500, detail=f"Task failed to create with {e}"
) from e


@router.post("/task-specific-ip", description="""
Expand All @@ -40,7 +42,9 @@ def task_specific_ip(Authorize: AuthJWT = Depends()):
task = create_ip_address_task.delay(current_user, '51.253.30.82')
return {"task_id": task.id}
except Exception as e:
raise HTTPException(status_code=500, detail="Task failed to create") from e
raise HTTPException(
status_code=500, detail=f"Task failed to create with {e}"
) from e


@router.get("/status/{id}", description="Show the result of the task")
Expand Down

0 comments on commit a4bffad

Please sign in to comment.