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

Consider jsdoc/require-throws #290

Open
edg2s opened this issue Jun 18, 2020 · 4 comments
Open

Consider jsdoc/require-throws #290

edg2s opened this issue Jun 18, 2020 · 4 comments

Comments

@edg2s
Copy link
Member

edg2s commented Jun 18, 2020

gajus/eslint-plugin-jsdoc#574

@jdforrester
Copy link
Member

Generally I'd say yes, but I've seen some colleagues say that "@throws" should only happen when you expect the exception (e.g. you ask for the contents of the file and it doesn't exist), rather than runtime issues (like you ask for the file and the OS is out of memory). Is that something we care about?

@edg2s
Copy link
Member Author

edg2s commented Jun 18, 2020

runtime issues

Would those not be throws that happen deeper in the stack? Surely anything that is explicitly thrown by a method (which is all this will detect) should be documented?

@jdforrester
Copy link
Member

It was just the most obvious example that came to mind. Can give some real-world ones, but as I'm not the one pushing for this view (just reporting it), it'd be stronger if those who were did.

@edg2s
Copy link
Member Author

edg2s commented Jun 18, 2020

There are certainly throws that are never expected to happen in normal operation, but I still think it's useful for users of any method to know if it might throw. Obviously if the method itself doesn't catch all the possible exceptions of the calls it makes that those would be missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants