-
Notifications
You must be signed in to change notification settings - Fork 99
Allows for custom error messages #132
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
base: master
Are you sure you want to change the base?
Conversation
|
Good idea, thanks! I'd prefer the shorter notation self.respond(error || '…message…');over if(!error) error = '…message…';
self.respond(error);In the long run we should make a messages dictionary to deduplicate magic string constants and separate i18n from code more. PS: Github seems to not know the email address for your commits. That's not a problem for us, but you might want to double-check to optimize how you'll be represented in the commit log. |
|
About the null check: |
…stanceof and now supports ReadStream
|
Good points, I've made improvements to reflect your concerns. They should both abide your style-guide and provide more consistent error checking. |
First, the [null, undefined, false, 0, NaN, ''].map((x) => (x instanceof Array))
// [ false, false, false, false, false, false ]"Then":
How do you know whether there will be a safe-to-access The reason for just truthiness was not about coding style here, but about compatibility with custom filesystems. For me the improved compatibility would even warrant an exception from default style if required. Probably wouldn't hurt to add a reminder comment to the condition, e.g. "simplicity for sake of compatibility, cf. PR 132". In that spirit, I wonder what the Even if there wasn't an issue across sandboxes, what would be bad about arbitrary objects that implement the readable stream interface? We can't afford to test that at runtime for each fs object we receive, but |
No description provided.