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

Consistent errors / return values for blob getters #81

Closed
1 task
gmaclennan opened this issue Feb 28, 2023 · 1 comment
Closed
1 task

Consistent errors / return values for blob getters #81

gmaclennan opened this issue Feb 28, 2023 · 1 comment
Labels

Comments

@gmaclennan
Copy link
Member

Description

blobStore.get() does not consistently handle errors. Specifically, if data is not available, then sometimes it will return null and sometimes it will throw an error.

I think rather than returning null at all, it should always throw an error when data is not available and when it is not found.

It may be difficult / impossible to tell the difference between "not found" and "not downloaded" when the blob db has not replicated.

Tasks

  • Consistently throw an error for either not found blobs or not-downloaded blobs
@EvanHahn
Copy link
Contributor

EvanHahn commented Mar 7, 2024

I think this is done because:

  1. The code makes it look that way:
    https://github.com/digidem/mapeo-core-next/blob/30e637ba74168d106e17d7b3de349abd97f51c74/src/blob-store/index.js#L99-L101
  2. It was checked off in this GitHub comment
  3. I see it in 481c991

Closing as completed. Let me know if that's wrong and I'll reopen!

@EvanHahn EvanHahn closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants