Skip to content
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

InvalidParameters, UnhandledPromiseRejectionWarning, DeprecationWarning #4

Closed
siunus opened this issue Nov 22, 2019 · 3 comments
Closed

Comments

@siunus
Copy link

siunus commented Nov 22, 2019

(node:8765) UnhandledPromiseRejectionWarning: InvalidParameters: Invalid parameters
    at ovoidError (/var/www/nodejs/node_modules/ovoid/src/helper/errors.js:90:39)
    at rpOvo.catch.err (/var/www/nodejs/node_modules/ovoid/src/helper/request.js:23:7)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:8765) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:8765) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@apriady
Copy link
Owner

apriady commented Nov 22, 2019

Can provide detailed info about it?

@siunus
Copy link
Author

siunus commented Dec 25, 2019

I run the code below, then get an error like the one above.
ovoid.js.zip

`
const OVOID = require('ovoid');
const readline = require('readline');

let ovoid = new OVOID();

const r = readline.createInterface({
input: process.stdin,
output: process.stdout
});

var OVO_HP = null;
var OVO_OTP = null;
var OVO_PIN = null;

var tanyaHP = function() {
return new Promise((resolve, reject) => {
r.question('No HP OVO: ', (rOVOHP) => {
OVO_HP = rOVOHP;
resolve();
});
});
}

var tanyaOTP = function() {
return new Promise((resolve, reject) => {
r.question('OTP OVO: ', (rOVOOTP) => {
OVO_OTP = rOVOOTP;
resolve();
});
});
}

var tanyaPIN = function() {
return new Promise((resolve, reject) => {
r.question('PIN OVO: ', (rOVOPIN) => {
OVO_PIN = rOVOPIN;
resolve();
});
});
}

var init = async function() {
await tanyaHP();
let refId = await ovoid.login2FA(OVO_HP);

await tanyaOTP();
let accessToken = await ovoid.login2FAVerify(refId, OVO_OTP, OVO_HP);

await tanyaPIN();
let authToken = await ovoid.loginSecurityCode(OVO_PIN, accessToken);

ovoid = new OVOID(authToken);

let balanceCash = await ovoid.getBalance('cash');

console.log(balanceCash);

r.close();

}

init();
`

@apriady
Copy link
Owner

apriady commented Jan 7, 2020

Hi, I have update the documentation, there are some parameter that unclear in previous version of documentation. Can you try it again?

And also please update the ovoid to v1.2.1.

@apriady apriady closed this as completed Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants