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

Rework internal sync error handling #1490

Merged
merged 12 commits into from
Aug 25, 2023
Merged

Rework internal sync error handling #1490

merged 12 commits into from
Aug 25, 2023

Conversation

cmelchior
Copy link
Contributor

All the old SyncClient, SyncProtocol, and SyncSession errors are gone and have been rolled up into the general RealmError struct. This PR reworks our error handling to accommodate this.

Since we are hiding the real errors behind our exception hierarchy, there should be no visible change to end users. The only exception is the exception message which might now contain different categories and codes, but the behavior should be the same.

Some notable changes:

  • A CoreError class has been added that mirrors the C struct realm_error_t.
  • CategoryFlags have been expanded and are now also used for Sync Errors where it previously was only used for local exceptions.
  • Websocket errors have been exposed as an internal enum. They are not currently used, but will be needed for the Platform Networking project.

@cla-bot cla-bot bot added the cla: yes label Aug 25, 2023
@cmelchior cmelchior requested review from rorbech, nhachicha and clementetb and removed request for clementetb August 25, 2023 07:03
@cmelchior cmelchior marked this pull request as ready for review August 25, 2023 07:52
Copy link
Contributor

@rorbech rorbech left a comment

Choose a reason for hiding this comment

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

I bit hard to follow if all mappings are correct, but from the updated tests it seems like we have quite good coverage, so LGTM. Also nice to see that the error-design could cover such internal changes 🥇 🎉

@cmelchior cmelchior merged commit c8f3e0b into main Aug 25, 2023
1 check passed
@cmelchior cmelchior deleted the cm/reorganize-sync-errors branch August 25, 2023 10:19
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants