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

feature: add "onError" hook to generated clients #96

Closed
joshmossas opened this issue Sep 5, 2024 · 2 comments
Closed

feature: add "onError" hook to generated clients #96

joshmossas opened this issue Sep 5, 2024 · 2 comments
Labels
codegen Issues related to generator plugins enhancement New feature or request lang:dart lang:kotlin lang:rust lang:swift lang:ts

Comments

@joshmossas
Copy link
Member

Describe the feature

Adding an onError hook would allow you to intercept errors and trigger some side affect based on said error.

For example say your server begin returning a token expired error. Rather than needing to catch that error every time you call a procedure, an onError hook could trigger a side-effect that redirects the user to a login screen. Allowing you to handle this universal error in one place.

Additional context

None

Would you be willing to implement this feature?
Yes

@joshmossas
Copy link
Member Author

joshmossas commented Oct 8, 2024

Implementation Progress

Client Implemented
Typescript
Rust
Dart
Swift
Kotlin

@joshmossas
Copy link
Member Author

Finished in #102

Support not added for rust ATM since I don't feel like it right now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen Issues related to generator plugins enhancement New feature or request lang:dart lang:kotlin lang:rust lang:swift lang:ts
Projects
None yet
Development

No branches or pull requests

1 participant