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

fix(app): error handling improved #613

Merged
merged 9 commits into from
Oct 16, 2024
Merged

fix(app): error handling improved #613

merged 9 commits into from
Oct 16, 2024

Conversation

neSpecc
Copy link
Member

@neSpecc neSpecc commented Oct 12, 2024

Problem

If API will return error on app initialization, the whole app will break

image

Cause

  1. We don't have try-catch handling in many places, especially in app initialization
  2. We don't have common error handling pattern
  3. GraphQL API can return both response.data and response.errors. In this case data is ignored at the moment since errors are being thrown.

Solution

  1. We don't need to throw error from API. Just return it as well as data. It should be handled on a store/component level then.
  2. To not to break existing error handling, I've added explicit flag allowErrors to a single place (FETCH_INITIAL_DATA mutation) I touched.
  3. All API errors will be sent to Hawk.

Also

  1. Service Worker and PWA-plugin are removed to prevent problems with caching.
  2. Version now will be added to static file names on build (also, to prevent caching)
  3. Now we can track errors via Hawk not only on vue-level. The useErrorTracker() composable is created for that.
  4. Few minor fixes

@neSpecc neSpecc merged commit a19d84b into master Oct 16, 2024
2 checks passed
@neSpecc neSpecc deleted the fix-app-break branch October 16, 2024 19:05
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