js-sdk
js-sdk copied to clipboard
Cleanup: Create custom method unsupported errors
Describe the proposal
Today we find multiple instances of these in our codebase:
async subscribe(_storeName: string, _cb: SubscribeConfigurationCallback): Promise<SubscribeConfigurationStream> {
throw new Error('HTTP is currently not supported.');
}
getRegisteredActors(): Promise<string[]> {
throw new Error('GRPC is currently not supported.');
}
This proposal is to create two custom Errors: HttpNotSupportedError
and GrpcNotSupportedError
which can be reused in our code.
Hello @shubham1172 I'm new to contributing to open source, i came across this project after a while of searching and i would love to take on this issue. could you give me any pointers on how to go about it?? what file would i have to modify or what folder to create a new file for the custom error. Thank you and kind regards.
Hi @jriffs, welcome to this project 😊
I would probably add a new errors
dir here https://github.com/dapr/js-sdk/tree/main/src/types and create custom error classes, and then replace HTTP/gRPC is not supported
errors in the codebase with these types. Please feel free to create a draft PR and then we can discuss more implementation details there.