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

Exceptions are actually duplicated #16

Closed
glureau opened this issue Feb 25, 2022 · 3 comments
Closed

Exceptions are actually duplicated #16

glureau opened this issue Feb 25, 2022 · 3 comments
Assignees

Comments

@glureau
Copy link
Collaborator

glureau commented Feb 25, 2022

By default Kotlin generate exceptions in the js code but they are not visible in the Typescript code.

By exposing exceptions like CancellationException for Typescript, KustomExport actually generates a duplicated class in the js code. If passing one exception via a method is properly handled, if exception is thrown it's not wrapping the exception. So eventually we ends up with CancellationException and CancellationException_1 in the js code, and the instanceof is failing.

Proposed solution: use external + @JsExport instead of redefining those exception classes.

@glureau glureau self-assigned this Feb 25, 2022
@glureau
Copy link
Collaborator Author

glureau commented Mar 6, 2022

JsExport is not applicable to Exception, also we can't use package kotlin as it's reserved to kotlin itself.

Maybe generating a TS header could be enough to keep Exceptions inheritance?

@glureau
Copy link
Collaborator Author

glureau commented Apr 5, 2022

Related to #20

Not sure what's the best path yet...

@glureau
Copy link
Collaborator Author

glureau commented Apr 19, 2022

#20

Released in 0.5.0

@glureau glureau closed this as completed Apr 19, 2022
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

No branches or pull requests

1 participant