Skip to content

style: fix bare except Exception clauses#75

Closed
mango766 wants to merge 1 commit intoHKUDS:mainfrom
mango766:fix-bare-excepts
Closed

style: fix bare except Exception clauses#75
mango766 wants to merge 1 commit intoHKUDS:mainfrom
mango766:fix-bare-excepts

Conversation

@mango766
Copy link

Fixes #74. \n\nThis PR updates bare except Exception: clauses to except Exception as e:. Bare excepts without variable assignment can hide bugs and make debugging difficult. Binding the exception to a variable is a standard Python best practice. Even if the exception isn't used immediately, it's safer and clearer for the future.

…ommit updates bare `except Exception:` clauses to `except Exception as e:`. Bare excepts without variable assignment can hide bugs and make debugging difficult. Binding the exception to a variable is a standard Python best practice.
@sehawq
Copy link
Collaborator

sehawq commented Mar 14, 2026

This PR changes except Exception: to except Exception as e:, but e is never used.
If the goal is better debuggability, maybe add logger.exception(...) or use a narrower exception.
Otherwise this is just a style change and could introduce unused-variable lint warnings later.

@sehawq sehawq closed this Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Style: Use explicit exception variable binding (except Exception as e:)

2 participants