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

Error in writestream does not throw error #83

Open
chuyouchia opened this issue Mar 7, 2024 · 2 comments
Open

Error in writestream does not throw error #83

chuyouchia opened this issue Mar 7, 2024 · 2 comments

Comments

@chuyouchia
Copy link

chuyouchia commented Mar 7, 2024

Hi there, thanks for creating the node-client! I was implementing Authzed at work and was trying to get the experimental service's bulkImportRelationships to throw errors when it fails. Specifically, I was trying to throw an error while using a Writestream created using the client library v0.13.0.
image

^ In the callbacks I actually implemented callbacks in a bunch of places to try and get the error to appear.

However, it seems like these errors do not propagate (or thrown) up to the context where they have been called, even though the code execution managed to log the error. Screenshot attached below:

image

@chuyouchia
Copy link
Author

I am not sure if I am using the library properly, would greatly appreciate any clarifications on this matter!

@tstirrat15
Copy link
Contributor

I'm not sure if that's how callbacks typically handle errors. My sense is that when you're throwing the error, you're not throwing it in the parent context, but rather the execution context internal to the call. I think it's functionally similar to calling setTimeout(() => throw new Error('oops!')) in that it isn't in the control flow of the code that dispatched it.

What are you hoping to do with that error?

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

2 participants