-
Notifications
You must be signed in to change notification settings - Fork 74
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
TypeError: Client constructor requires an argument #185
Comments
The The
const client = new require('node-rfc').Client();
const client = new require('node-rfc').Client({ dest: "ZZZ" });
// or
const pool = new require('node-rfc').Pool({ connectionParameters: { dest: "ZZZ" } }); Hope this helps. |
Following code is working and as soon as I change any connection parameter (abapSystem) to something wrong the app still just crash. I would like to have a proper error message in case of wrong username/password. I wonder if that is possible. Complete Code: const abapSystem = {
SYSNR:'00',
ASHOST:'v75',
CLIENT:'800',
USER:'ddic',
PASSWD:'password',
LANG:'en',
CODEPAGE:'8400',
TRACE:'2'
};
const noderfc = require ('node-rfc');
const pool = new noderfc.Pool({ connectionParameters: abapSystem, poolOptions: { low: 2, high: 10 }} );
module.exports = (async () => {
try {
var rfcClient = await pool.acquire();
var download = await rfcClient.call("BAPI_USER_GETLIST", {MAX_ROWS: 10});
} catch (err) {
console.log(err);
}
finally {
rfcClient.release();
console.log("entering and leaving the finally block");
return download;
}
})(); |
Thank you for the example. Yes, it is bug, now fixed and shipped in 2.3.1 release. Errors are raised like in pool/errors.spec.js unit tests. |
Hello ! Even a fresh installation goes wrong: Is it a personal problem or could it maybe a problem in general ? |
Yes, the general problem, will be fixed in next release. The installation and build from source work for N-API 7 node versions only: >= 12.19.0, >= 14.12.0. For now, you can install with these N-API 7 node versions and use from any node-version. |
Thank you for the instruction. I have tested all scenarios I could think of and its just working perfect. |
Glad to hear. I will open another ticket for the installation issue. |
Hello, according to your documentation try catch is working but at least in case of wrong ip or wrong username/password it doesnt work for me.
While the trace log is showing hostname 'asdf' unknown the app just crash with this:
throw new TypeError(
Client constructor requires an argument
);Can you confirm please ?
Example Code:
thank you
The text was updated successfully, but these errors were encountered: