Skip to content

Commit 13b4253

Browse files
rate limit error now communicated clearly (#39)
* rate limit error now communicated clearly * formatted
1 parent c6f7bc4 commit 13b4253

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
## Example Report
5252

53-
View a sample annotation report: <a href="https://nygen-labs-prod--cytetype-api.modal.run/report/0470bedf-f7c8-4168-9c34-fa4eb3ab35d4?v=250710" target="blank">CyteType Report</a>
53+
View a sample annotation report: <a href="https://nygen-labs-prod--cytetype-api.modal.run/report/77069508-d9f1-4a79-bdab-5870fc3ccdf3?v=250722" target="blank">CyteType Report</a>
5454

5555

5656

cytetype/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .main import CyteType
22

33
__all__ = ["CyteType"]
4-
__version__ = "0.8.0"
4+
__version__ = "0.8.1"

cytetype/client.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,32 +56,20 @@ def submit_job(
5656
# Check for authentication/authorization errors
5757
if e.response.status_code == 401:
5858
logger.error("❌ Authentication failed: Invalid or expired auth token")
59-
logger.error("Please check your auth_token and ensure it's valid.")
60-
logger.error(
61-
"If you're using a shared server, contact your administrator for a valid token."
62-
)
6359
raise CyteTypeAPIError(
6460
"Authentication failed during job submission"
6561
) from e
6662
elif e.response.status_code == 403:
6763
logger.error("❌ Authorization failed: Access denied")
6864
logger.error("Your auth token doesn't have permission to submit jobs.")
69-
logger.error(
70-
"If you're using a shared server, contact your administrator for proper permissions."
71-
)
7265
raise CyteTypeAPIError(
7366
"Authorization failed during job submission"
7467
) from e
7568
elif e.response.status_code == 422:
76-
# 422 might indicate auth issues if server is configured to check auth
7769
if auth_token and "auth" in str(error_details).lower():
7870
logger.error(
7971
"❌ Authentication may have failed (server returned validation error)"
8072
)
81-
logger.error("Please check your auth_token and ensure it's valid.")
82-
logger.error(
83-
"If you're using a shared server, contact your administrator for a valid token."
84-
)
8573
raise CyteTypeAPIError(
8674
"Possible authentication failure during job submission"
8775
) from e
@@ -90,6 +78,11 @@ def submit_job(
9078
raise CyteTypeAPIError(
9179
f"Validation error during job submission: {error_details}"
9280
) from e
81+
elif e.response.status_code == 429:
82+
logger.error("❌ Rate limit exceeded")
83+
raise CyteTypeAPIError(
84+
"Rate limit exceeded. Rate limit is 5 annotation jobs every 24hrs."
85+
) from e
9386

9487
logger.debug(
9588
f"Network or HTTP error during job submission: {e}. Details: {error_details}"

0 commit comments

Comments
 (0)