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

what about throw; (and throw undefined || null || 0 || false || "";) #46

Closed
Arlen22 opened this issue Sep 14, 2024 · 3 comments
Closed

Comments

@Arlen22
Copy link

Arlen22 commented Sep 14, 2024

What if a function throws undefined? I thought I should mention it. I can't really think of any way to gracefully handle that. I mean, a void function that throws is now just returning, but maybe that's the point, since if you're throwing undefined anyway, is anyone really going to care?

I'm willing to bet that a function which throws undefined really doesn't care any more.

I think the same logic probably applies to throwing the other falsey values.

I thought of rethrowing anything that doesn't extend Error, but I don't think we should rethrow anything. If someone isn't throwing an Error instance, they're not expecting anyone else to use their code.

@Arlen22 Arlen22 changed the title what about throw;? what about throw; (and throw undefined || null || 0 || false || "";) Sep 14, 2024
@Arlen22
Copy link
Author

Arlen22 commented Sep 14, 2024

Would there be benefit in providing a Boolean third argument which indicates success?

@Arlen22
Copy link
Author

Arlen22 commented Sep 14, 2024

this is more or less addressed in #30

@Arlen22 Arlen22 closed this as completed Sep 14, 2024
@arthurfiorette
Copy link
Owner

#30 (comment)

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