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

Cleanup: Create custom method unsupported errors #297

Open
shubham1172 opened this issue Jun 13, 2022 · 2 comments
Open

Cleanup: Create custom method unsupported errors #297

shubham1172 opened this issue Jun 13, 2022 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@shubham1172
Copy link
Member

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.

@jriffs
Copy link
Contributor

jriffs commented Jun 3, 2023

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.

@shubham1172
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants