check for missing did error and provide helpful error message#70
check for missing did error and provide helpful error message#70
Conversation
| await ceramic.admin.startIndexingModels(modelIDs) | ||
| try { | ||
| await ceramic.admin.startIndexingModels(modelIDs) | ||
| } catch(e: MissingDIDError) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
the purpose here is to make the error clearer specifically for missing did. other errors will continue to behave as they do now.
There was a problem hiding this comment.
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?
[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.
Definition of Done
Before submitting this PR, please make sure:
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.