简体   繁体   中英

Error: read ECONNRESET when executing the javascript file

I want to access the Untis-API by using the npm package untis-api .

When I run the javascript file I get this error:

node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}

My Code:

const w = require("untis-api");
const e = w.entities;

w.connect("USERNAME", "PASSWORD", "SCHOOL", "URL").then(() => {
    w.getTeachers().then(teachers => {
      console.log(teachers);
    }).catch(err => {
        console.log(err);
    });

    w.logOut();
}).catch(err => {
    console.log(err);
});

How can I fix this?

I'm using Node Version 16.15.0

It was an error at the webuntis server. Due to a DDoS Attack, the service was temporarily unavailable. This causes the error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM