-
Notifications
You must be signed in to change notification settings - Fork 38
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
Callback function should receive error parameter #2
Comments
Original comment by Xu Meng (Bitbucket: mengxumx, GitHub: dmabupt). Yes, this is a design issue. We should follow the Node.js callback style -- https://nodejs.org/dist/latest-v4.x/docs/api/errors.html#errors_node_js_style_callbacks |
- allow Connection.js to accept a single object for construction IBM#25 - rework Connection.run() function to return Errors #2 - rename internal variables away from I_* prefix - rename conn -> transportOptions - rename getConnection() -> getTransportOptions() - leave setting defaults and validation of transportOptions up to the transport - rename cmd -> commandList
- allow Connection.js to accept a single object for construction IBM#25 - rework Connection.run() function to return Errors #2 - rename internal variables away from I_* prefix - rename conn -> transportOptions - rename getConnection() -> getTransportOptions() - leave setting defaults and validation of transportOptions up to the transport - rename cmd -> commandList
Allow Connection.js Constuctor to accept a single object see IBM#25 Allow Connection.run() function to return error as first param of callback see #2 Establish one code path in Connection Constructor - when pre v1.0 signature is used create an options object - add properties to this options object - this mimics the current v1.0 way of passing a signle object - that way constructor follows on code path Options object contain sub object transportOptions - This contains properties such as databse, username, etc - This sub object is passed to the transport Rename variables away from I_* prefix Rename getConnection() -> getTransportOptions() Rename cmd -> commandList Moved verbose to be a property of Connection - verbose is added to transportOptions during run() - this is because verbose can be adjusted with debug() - add print of xmlOutput also when in verbose mode
Allow Connection.js Constuctor to accept a single object see #25 Allow Connection.run() function to return error as first param of callback see #2 Establish one code path in Connection Constructor - when pre v1.0 signature is used create an options object - add properties to this options object - this mimics the current v1.0 way of passing a signle object - that way constructor follows on code path Options object contain sub object transportOptions - This contains properties such as databse, username, etc - This sub object is passed to the transport Rename variables away from I_* prefix Rename getConnection() -> getTransportOptions() Rename cmd -> commandList Moved verbose to be a property of Connection - verbose is added to transportOptions during run() - this is because verbose can be adjusted with debug() - add print of xmlOutput also when in verbose mode
PR #42 allows This can be configured by setting |
@abmusse To be clear, the default is to return errors ( |
@kadler Correct when using the old style |
Closing |
Original report by Aaron Bartell (Bitbucket: aaronbartell, GitHub: aaronbartell).
Currently the iToolkit callback function only operates on a single result parameter and doesn't also include an error parameter. Errors could result from the DB2 connection.
Would be good to add this so errors can be conveyed.
The text was updated successfully, but these errors were encountered: