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

Refactor errors #96

Merged
merged 27 commits into from
Oct 14, 2024
Merged

Refactor errors #96

merged 27 commits into from
Oct 14, 2024

Conversation

andrii-balitskyi
Copy link
Collaborator

@andrii-balitskyi andrii-balitskyi commented Aug 20, 2024

wrt #71 and #115

lib/seam/errors.rb Outdated Show resolved Hide resolved
@andrii-balitskyi andrii-balitskyi removed the request for review from razor-x October 3, 2024 13:25
@andrii-balitskyi andrii-balitskyi marked this pull request as draft October 3, 2024 13:25
@andrii-balitskyi andrii-balitskyi marked this pull request as ready for review October 3, 2024 13:25
Copy link
Contributor

@razor-x razor-x left a comment

Choose a reason for hiding this comment

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

Looks like this is still missing a refactor for SeamAuth and SeamOptions?

lib/seam/http.rb Outdated Show resolved Hide resolved
lib/seam/http.rb Outdated Show resolved Hide resolved
lib/seam/wait_for_action_attempt.rb Outdated Show resolved Hide resolved
@andrii-balitskyi
Copy link
Collaborator Author

Looks like this is still missing a refactor for SeamAuth and SeamOptions?

@razor-x Yea, how the refactor should look like? Should those be also part of Http module?
For ex., SeamAuth -> Seam::Http::InvalidTokenError and Seam::Http.get_auth_headers or Seam::Http::Auth::InvalidTokenError and Seam::Http::Auth.get_auth_headers.
And SeamOptions -> Seam::Http::InvalidOptionsError and Seam::Http.parse_options?

@razor-x
Copy link
Contributor

razor-x commented Oct 3, 2024

Moving the module into Seam::Http::Auth::InvalidTokenError should be ok. This is all internal, it just didn't make sense before to have a top level SeamAuth module. We can do Seam::Http::Options as well.

Alternatively, Seam::Http::Options and Seam::Http::Auth are classes and Seam::Http::InvalidTokenError and Seam::Http::InvalidOptionsError are thrown by the class. Either approach is fine since these are all internal modules / classes / errors. The user is not meant to handle them in their code like they would the public errors like ActionAttemptFailedError etc.

@andrii-balitskyi
Copy link
Collaborator Author

@razor-x I did the SeamAuth and SeamOptions refactor here fc69841

@andrii-balitskyi andrii-balitskyi merged commit 14effe0 into main Oct 14, 2024
20 checks passed
@andrii-balitskyi andrii-balitskyi deleted the refactor-errors branch October 14, 2024 16:25
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.

3 participants