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

check for missing did error and provide helpful error message #70

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gvelez17
Copy link
Contributor

[Replace Me With Meaningful Name] - #[Issue]

Description

This uses the new MissingDIDError class to identify what specific suggestion to make to the composedb user to solve that error in this context.

This is a draft bc it is not clear to me how to code the dependency on the js-ceramic updated version

How Has This Been Tested?

Describe the tests that you ran to verify your changes. Provide instructions for reproduction.

  • Test A (e.g. Test A - New test that ... ran in local, docker, and dev unstable.)
  • Test B

Definition of Done

Before submitting this PR, please make sure:

  • The work addresses the description and outcomes in the issue
  • I have added relevant tests for new or updated functionality
  • My code follows conventions, is well commented, and easy to understand
  • My code builds and tests pass without any errors or warnings
  • I have tagged the relevant reviewers
  • I have updated the READMEs of affected packages
  • I have made corresponding changes to the documentation
  • The changes have been communicated to interested parties

References:

Please list relevant documentation (e.g. tech specs, articles, related work etc.) relevant to this change, and note if the documentation has been updated.

@gvelez17 gvelez17 marked this pull request as draft January 12, 2023 17:46
await ceramic.admin.startIndexingModels(modelIDs)
try {
await ceramic.admin.startIndexingModels(modelIDs)
} catch(e: MissingDIDError) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this the only type of error that can happen please? What if the node is unreachable and there's a HTTP 404 error instead for example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the purpose here is to make the error clearer specifically for missing did. other errors will continue to behave as they do now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry I'm not sure I follow.
Here the e: MissingDIDError assumes that the thrown error can only be MissingDIDError, but that's not guarantied to be the cases, is it? What happens if the HTTP client throws another type of error, wouldn't the error message incorrectly refer to the missing DID when it can be other types of errors, like an incorrect Ceramic node endpoint or invalid model IDs input?

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.

2 participants