From e3c384c0ce7a694f3f55763a724071163f99d507 Mon Sep 17 00:00:00 2001 From: Henrique Godoy <95002561+herniqeu@users.noreply.github.com> Date: Sat, 31 Oct 2026 22:22:26 -0300 Subject: [PATCH] fix(samples): raise the caught ServerResponseError instead of rError In the second error handler of create_group.py the except clause binds `serverError`, but the re-raise uses `rError`, the name bound by the first handler further up. Python deletes the exception name when the except block ends, so `rError` is not defined there: every API error other than 409011 surfaced as NameError instead of the server message. Verified with pyflakes: undefined name 'rError' gone, no new undefined name. Signed-off-by: Henrique Godoy <95002561+herniqeu@users.noreply.github.com> --- samples/create_group.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/create_group.py b/samples/create_group.py index aca3e895b..bbc2b830f 100644 --- a/samples/create_group.py +++ b/samples/create_group.py @@ -80,7 +80,7 @@ def main(): if serverError.code == "409011": print(f"user {user.name} is already a member of group {group.name}") else: - raise rError + raise serverError for user in group.users: print(user.name)