Bump version to 1.0.2 in package.json, add error logging for cookie loading in Config class, and log CookieJar content in registrieren function
This commit is contained in:
parent
2bc5c2cce6
commit
1c81633b4c
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "agrarmonitorlib",
|
"name": "agrarmonitorlib",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"description": "Node.js library for Agrarmonitor",
|
"description": "Node.js library for Agrarmonitor",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -27,6 +27,7 @@ class Config {
|
|||||||
return CookieJar.fromJSON(data);
|
return CookieJar.fromJSON(data);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.log("fehler beim laden der cookies:", e)
|
||||||
// Fehler beim Laden, leere Jar zurückgeben
|
// Fehler beim Laden, leere Jar zurückgeben
|
||||||
}
|
}
|
||||||
return new CookieJar();
|
return new CookieJar();
|
||||||
|
|||||||
@ -13,6 +13,9 @@ const { JSDOM } = require('jsdom');
|
|||||||
async function registrieren(config, agrarmonitorId, pcName) {
|
async function registrieren(config, agrarmonitorId, pcName) {
|
||||||
const cookieJar = config.cookieJar;
|
const cookieJar = config.cookieJar;
|
||||||
|
|
||||||
|
// Cookie-Jar Inhalt loggen
|
||||||
|
console.log('🍪 CookieJar Inhalt:', JSON.stringify(cookieJar.toJSON(), null, 2));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!agrarmonitorId || !pcName) {
|
if (!agrarmonitorId || !pcName) {
|
||||||
console.error('❌ AgrarmonitorID oder PC-Name fehlt');
|
console.error('❌ AgrarmonitorID oder PC-Name fehlt');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user