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: error system; add Fatal and API errors #94

Merged
merged 1 commit into from
Jan 9, 2022

Conversation

drmingdrmer
Copy link
Member

Changelog

Refactor: error system; add Fatal and API errors
  • Add: Fatal as a collection of all errors that will shutdown a raft
    node. Currently it has only one sub-error: StorageError.

  • Add: error types for every API, such as AppendEntriesError or
    VoteError.

  • Remove: map_storage_error() and map_fatal_storage_error().
    A fatal error should be popped up and be dealt with at the top level.
    Avoid changing target state everywhere, which is hard to review or
    debug.

  • Use crate anyerror as a wrapper of external error.

  • Remove: RaftError, which is vague about what it is for.

  • Makes API error serializable for transport.


- Add: Fatal as a collection of all errors that will shutdown a raft
  node. Currently it has only one sub-error: StorageError.

- Add: error types for every API, such as AppendEntriesError or
  VoteError.

- Remove: `map_storage_error()` and `map_fatal_storage_error()`.
  A fatal error should be popped up and be dealt with at the top level.
  Avoid changing target state everywhere, which is hard to review or
  debug.

- Use crate anyerror as a wrapper of external error.

- Remove: RaftError, which is vague about what it is for.

- Makes API error serializable for transport.
@drmingdrmer drmingdrmer marked this pull request as ready for review January 9, 2022 16:41
@drmingdrmer drmingdrmer merged commit a0d7829 into databendlabs:main Jan 9, 2022
@drmingdrmer drmingdrmer deleted the refact-err branch January 10, 2022 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant