@okta/okta-sdk-nodejs Unhandled Promise Rejection Warning being thrown

using GitHub - okta/okta-sdk-nodejs: Node.js API Client for the Okta Platform API

I’m getting an UnhandledPromiseRejectionWarning, why is this being cause and how can I avoid it?

const client = new okta.Client({
orgUrl: ‘https://{{org}}.oktapreview.com/’,
authorizationMode: ‘PrivateKey’,
clientId: ‘{{clientId}}’,
scopes: [‘okta.users.manage’],
privateKey: JSON.stringify(privateKey) });
try {
const orgUsers = client.listUsers();
orgUsers.each(user => {
console.log(user);
}).then(() => console.log(‘All users have been listed’));
} catch (e) {
console.log(e);
}

please see here for an explaination

this issue is resolved

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.