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: bubble init usage and errors to simplify recovery #221

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

FoxxMD
Copy link
Owner

@FoxxMD FoxxMD commented Oct 31, 2024

Checklist before requesting a review

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Describe your changes

Need to refactor how initialize() is used so that is bubbles errors instead of just logging them. This way we can use the actual error reasons for notify or when user invokes API to show reasons for component not being able to recover. Needs work:

  • Throw error from init and refactor all usage to try-catch OR introduce initAndLog as convenience method
  • Refactor api usage to enable force init when things aren't working as planned and user wants to force a full recovery
  • Refactor notify usage to pull error causes and consolidate where these happen
  • Refactor remaining uses of testAuth to try-catch
  • Maybe introduce child Error classes for init steps to make extracting the desired error cause easier?
  • Implement or refactor poll endpoints so allow re-initializing non-polling components as well

Issue number and link, if applicable

#220
#231

@FoxxMD FoxxMD added the enhancement New feature or request label Oct 31, 2024
@FoxxMD FoxxMD self-assigned this Oct 31, 2024
@FoxxMD FoxxMD marked this pull request as draft October 31, 2024 14:44
@FoxxMD FoxxMD marked this pull request as ready for review December 11, 2024 18:20
@FoxxMD FoxxMD added the safe to test trusted to build image label Dec 11, 2024
Copy link
Contributor

📦 A new release has been made for this pull request.

To play around with this PR, pull an image:

  • foxxmd/multi-scrobbler:pr-221

Images are available for x86_64 and ARM64.

Latest commit: 3e230b0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request safe to test trusted to build image
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant