Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception cleanup #895

Merged
merged 4 commits into from
Feb 29, 2024
Merged

Exception cleanup #895

merged 4 commits into from
Feb 29, 2024

Conversation

jdknight
Copy link
Member

update exceptions to use f-strings

Drop various uses of format that can be replaced with f-strings when building exception messages.

move confluence-specific config exception into a new file

Moving the exception ConfluenceConfigurationError into its own exception file under config. This is to prepare for updates to configuration exceptions, where various exception cases will have their own class instead of custom messages defined in scenarios like the configuration check call.

rename confluence-specific config exception

Renaming the exception ConfluenceConfigurationError into a smaller ConfluenceConfigError name; still conveys the meaning at a much smaller text length. Also follows Sphinx's ConfigError name.

build configuration-specific exceptions

Updating the configuration checks logic to raise specific configuration exception cases instead of a generic configuration error. This is to help avoid rendering content of any string literals in the stack trace outside the message itself (EM101).

In addition, the exception messages built have been updated to take advantage of f-strings (to avoid the need to format these messages), as well as performing proper exception chaining.

Drop various uses of format that can be replaced with f-strings when
building exception messages.

Signed-off-by: James Knight <james.d.knight@live.com>
Moving the exception `ConfluenceConfigurationError` into its own
exception file under `config`. This is to prepare for updates to
configuration exceptions, where various exception cases will have their
own class instead of custom messages defined in scenarios like the
configuration check call.

Signed-off-by: James Knight <james.d.knight@live.com>
Renaming the exception `ConfluenceConfigurationError` into a smaller
`ConfluenceConfigError` name; still conveys the meaning at a much
smaller text length. Also follows Sphinx's `ConfigError` name.

Signed-off-by: James Knight <james.d.knight@live.com>
Updating the configuration checks logic to raise specific configuration
exception cases instead of a generic configuration error. This is to
help avoid rendering content of any string literals in the stack trace
outside the message itself (EM101).

In addition, the exception messages built have been updated to take
advantage of f-strings (to avoid the need to format these messages), as
well as performing proper exception chaining.

Signed-off-by: James Knight <james.d.knight@live.com>
@jdknight jdknight merged commit 601e591 into main Feb 29, 2024
29 checks passed
@jdknight jdknight deleted the exception-cleanup branch February 29, 2024 06:18
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.

1 participant