-
Notifications
You must be signed in to change notification settings - Fork 5
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
getResource() should take a callback and an optional timeout and error function #22
Comments
I'm going through email and to do items and creating bugs. Below is an email thread about getResource(). On 7/2/17 8:23 AM, Edward A. Lee wrote:
On Jul 7, 2017, at 11:48 AM, Christopher Brooks wrote:
On Fri, Jul 7, 2017 at 9:17 PM, Edward A. LEE wrote:
On Aug 13, 2017, at 2:26 AM, Marten Lohstroh wrote:
On 8/13/17 9:49 AM, Marten Lohstroh wrote:
|
The current documentation for getResource is at 4. Getting Resources
https://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions/ says: -> In node.js, it is considered standard practice to handle errors in asynchronous functions by returning them as the first argument to the current function's callback. If there is an error, the first parameter is passed an Error object with all the details. Otherwise, the first parameter is null. You can see this in https://nodejs.org/api/fs.html#fs_fs_readfile_path_options_callback --start-- History
Asynchronously reads the entire contents of a file. Example: fs.readFile('/etc/passwd', (err, data) => { The callback is passed two arguments (err, data), where data is the contents of the file. If no encoding is specified, then the raw buffer is returned. If options is a string, then it specifies the encoding. Example: fs.readFile('/etc/passwd', 'utf8', callback); Adding another toplevel function to the system is tedious, but we also want to keep backward compatibility. Currently, the default is to return a string. It also seems that the timeout argument is ignored. We could redefine the function to be getresource(path, options, callback)
where the first argument of the callback are: |
Note: the issue was created automatically with bugzilla2github tool
Original bug ID: BZ#22
From: @cxbrooks
Reported version: unspecified
CC: [email protected]
The text was updated successfully, but these errors were encountered: