Skip to content

Commit cbb0f52

Browse files
committed
set_rate_limit_group add error messages
1 parent 037c996 commit cbb0f52

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

aikido_zen/middleware/set_rate_limit_group.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@
44

55
def set_rate_limit_group(group_id: str):
66
if not group_id or not isinstance(group_id, str):
7-
logger.warning("")
7+
logger.warning("Group ID cannot be empty.")
88
return
99

1010
context = get_current_context()
1111
if not context:
12-
logger.warning("")
12+
logger.warning(
13+
"set_rate_limit_group(...) was called without a context. Make sure to call set_rate_limit_group(...) within an HTTP request."
14+
)
1315
return
1416

1517
if context.executed_middleware:
16-
logger.warning("")
18+
logger.warning(
19+
"set_rate_limit_group(...) must be called before the Zen middleware is executed."
20+
)
1721

1822
context.rate_limit_group = group_id
1923
context.set_as_current_context()

0 commit comments

Comments
 (0)