Skip to content

Conversation

@iambriccardo
Copy link
Contributor

@iambriccardo iambriccardo commented Jul 25, 2025

This PR reworks error handling in the etl crate to make it more library-like. Instead of defining many error types for each module, we now have a single main error type, and we group related errors using ErrorKind, which allows us to statically identify the error category without needing to examine the error in detail.

With this mechanism, we are able to write much cleaner code, with less detailed error information, but still accurate enough to define custom strategies for failure retry policies. This work, specifically, will happen after this PR is merged, as we needed a foundational redesign of the error system before addressing more complex error recovery and handling.

In addition to the new error system, this PR includes:

  • More tests with failure injection that assert the new error types.
  • Refactors the ReactiveFuture initialization method name to wrap.
  • Removes unused dependencies.

Currently, the number of ErrorKind variants is based on what we expect to distinguish when handling errors. This is expected to evolve, as we may need to handle more specific groups of errors in the future, requiring additional ErrorKind variants. However, I did not attempt to define the ideal set of variants in this PR, as it’s not feasible to identify all possibilities without using them in real-world error handling. For now, the system simply propagates errors through.

@iambriccardo iambriccardo marked this pull request as ready for review July 25, 2025 15:31
@iambriccardo iambriccardo requested a review from a team as a code owner July 25, 2025 15:31
Copy link
Contributor

@imor imor left a comment

Choose a reason for hiding this comment

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

Overall looks good apart from a debuggability concern due to some errors we are suppressing.

@iambriccardo iambriccardo requested a review from imor July 28, 2025 07:39
@iambriccardo iambriccardo merged commit 740a6be into main Jul 28, 2025
3 checks passed
@iambriccardo iambriccardo deleted the riccardobusetti/etl-141-investigate-the-possibility-to-reduce-the-number-of-error branch July 28, 2025 07:57
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