PoC: improve error handling #45

Merged
rozetko merged 1 commits from poc-improve-error-handling into main 2 years ago
rozetko commented 2 years ago (Migrated from github.com)
Owner

Related issue: #42

This PR updates .learn() AnalyticUnits' method to return error instead of panicking. It'd be great to do the same for other methods

Changes:

  • analytic units:
    • change .learn() return type from LearningResult to anyhow::Result<LearningResult>
    • get rid of unwraps in .learn() mostly
  • remove DatasourceError from LearningResult
  • remove LearningDatasourceError from ResponseType (Err is used instead)

P.S. it'd be nice to create custom error types also

Related issue: #42 This PR updates `.learn()` `AnalyticUnit`s' method to return error instead of panicking. It'd be great to do the same for other methods Changes: - analytic units: - change `.learn()` return type from `LearningResult` to `anyhow::Result<LearningResult>` - get rid of `unwrap`s in `.learn()` mostly - remove `DatasourceError` from `LearningResult` - remove `LearningDatasourceError` from `ResponseType` (`Err` is used instead) P.S. it'd be nice to create custom error types also
glitch4347 (Migrated from github.com) approved these changes 2 years ago

Reviewers

The pull request has been merged as 3cc85c289f.
Sign in to join this conversation.
Loading…
There is no content yet.