-
Notifications
You must be signed in to change notification settings - Fork 189
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
Export errors from main #402
Conversation
I'm currently using these errors as internal helpers in a way and don't want to export all of them (exporting the folder also exports the actual errors/helpers.ts file, which should remain internal). I'm thinking only the |
Sounds fair, I'm actually not that familiar with all the other exceptions. The rule I would use is that any that can be thrown by the public API are part of the public API and should be exported. Any that are thrown and caught internally needn't be. WRT inheritance hierarchies, I don't see much value in it. It seems like indirection. For example I got a What's the point of subclassing if you do not export the errors? |
- FileNotFoundError and DirectoryNotFoundError inherit from PathNotFoundError in order to allow just checking for PathNotFoundError.
Good points! I exported all of them and will make a release soon (probably tomorrow). |
* Export errors from main * Move classes to separate folder so they can be exported on their own. * Constructors internal. * FileNotFoundError and DirectoryNotFoundError inherit from PathNotFoundError in order to allow just checking for PathNotFoundError.
Export errors from module.
It's not possible to access
code
without usingany
. Export error classes for use in type guards.