pchampin / sophia_rs

Sophia: a Rust toolkit for RDF and Linked Data
Other
214 stars 23 forks source link

Replace coercible errors #29

Closed MattesWhite closed 4 years ago

MattesWhite commented 4 years ago

This PR replaces the coercible-errors-crate by StreamError, defined like following:

#[derive(Debug)]
pub enum StreamError<SourceErr, SinkErr>
where
    SourceErr: 'static + Error,
    SinkErr: 'static + Error,
{
    Source(SourceErr),
    Sink(SinkErr),
}

It allows function to return two different types of error, usually either an error from the Source providing new data or from the Sink that consumes it.

to do

As showed are the trait bounds for SourceErr and SinkErr only 'static + Error. This should be expanded by + Send + Sync in the future, in order to be able to implement concurrent graphs. The bound extension is delayed until sophia::error::Error is completly removed.

This PR is the result of #8 and was implemented according to #28

MattesWhite commented 4 years ago

Okay I have no idea why Travis failed. The log seems like it has built an old version of the parser-module? Did I something wrong at commiting?

pchampin commented 4 years ago

I'm assuming you didn't use the --all-features option when you ran the tests locally. So you are missing the feature-gated parts of the code (which, it seems, still refer to coercible-error).

I'm about to make a reviw of your PR, so you might want to wait for my comments before putting further work in iit. All in all, this is good, but there are a few changes that I'd like to suggest.

pchampin commented 4 years ago

@MattesWhite is this ready for merge? (guessing so, but just checking)

MattesWhite commented 4 years ago

Yes its ready 👍

pchampin commented 4 years ago

Ok, I'll try to do it during the week-end. And I'll also try to push and merge my work on #24. The latter is impacting almost all files in the repo, so I advice you don't start any work until it's done -- merging it afterwards would be hell. Thanks again for your help.