Skip to content

fix(toolbox-core)!: Standardize on ValueError for improved error consistency #219

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

Merged
merged 5 commits into from
May 12, 2025

Conversation

anubhav756
Copy link
Contributor

This PR updates instances where generic Exception objects were thrown in toolbox-core to use ValueError instead.

This aligns with the prevalent use of ValueError for argument-related issues elsewhere in the package, leading to more specific, predictable, and robust error handling for consumers of toolbox-core.

@anubhav756 anubhav756 self-assigned this May 5, 2025
@anubhav756 anubhav756 requested a review from a team as a code owner May 5, 2025 14:13
@anubhav756 anubhav756 force-pushed the anubhav-refactor-auth-header branch from 7e5d768 to 4fbe671 Compare May 5, 2025 14:20
Copy link
Contributor

@kurtisvg kurtisvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I think this is fix!:

@anubhav756 anubhav756 force-pushed the anubhav-refactor-auth-header branch from 4fbe671 to e6396b6 Compare May 12, 2025 13:22
Base automatically changed from anubhav-refactor-auth-header to main May 12, 2025 13:30
@anubhav756 anubhav756 changed the title chore(toolbox-core): Standardize on ValueError for improved error consistency fix(toolbox-core)!: Standardize on ValueError for improved error consistency May 12, 2025
Post adding the feature of adding client-level auth headers (#178), we have the logic for creating an auth header, from the given auth token getter name, in 3 different places.

This PR unifies all of that logic into a single helper to improve maintenance, and make it easier to change the way we add suffix/prefix, and reduces WET code.
…sistency

This PR updates instances where generic `Exception` objects were thrown in `toolbox-core` to use `ValueError` instead.

This aligns with the prevalent use of `ValueError` for argument-related issues elsewhere in the package, leading to more specific, predictable, and robust error handling for consumers of `toolbox-core`.
@anubhav756 anubhav756 merged commit cdfaaf8 into main May 12, 2025
19 checks passed
@anubhav756 anubhav756 deleted the anubhav-error branch May 12, 2025 13:42
@release-please release-please bot mentioned this pull request May 12, 2025
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.

2 participants