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

Remove generics on error types. #75

Merged
merged 4 commits into from
Jun 21, 2024
Merged

Conversation

timothee-haudebourg
Copy link
Owner

Most of the error types in json-ld currently needs to be provided with the loader error type as generic parameter. Dealing with generic type parameters on error types is really annoying, as it propagates everywhere. This PR fixes this erasing the loader error type using a LoaderError trait allowing the different algorithm to transform a loader error into an IRI (causing the error) and an error message. I believe this will be enough in the majority of cases to give enough info about the error while reducing the burden propagating type generics.

This decision was made while fixing the FsLoader to allow multiples IRIs bound to the same path, to allow easy debugging. For this reason this PR also includes a fix for the FsLoader.

Unverified

This user has not yet uploaded their public signing key.
Fix `FsLoader` to allow multiples IRIs bound to the same path.
@timothee-haudebourg timothee-haudebourg merged commit cb43034 into main Jun 21, 2024
2 checks passed
@timothee-haudebourg timothee-haudebourg deleted the remove-error-generics branch June 21, 2024 11:18
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.

None yet

1 participant