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:
Björn Pöttker 2025-08-30 11:18:52 +02:00
parent 2bc5c2cce6
commit 1c81633b4c
3 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "agrarmonitorlib",
"version": "1.0.1",
"version": "1.0.2",
"description": "Node.js library for Agrarmonitor",
"main": "src/index.js",
"scripts": {

View File

@ -27,6 +27,7 @@ class Config {
return CookieJar.fromJSON(data);
}
} catch (e) {
console.log("fehler beim laden der cookies:", e)
// Fehler beim Laden, leere Jar zurückgeben
}
return new CookieJar();

View File

@ -13,6 +13,9 @@ const { JSDOM } = require('jsdom');
async function registrieren(config, agrarmonitorId, pcName) {
const cookieJar = config.cookieJar;
// Cookie-Jar Inhalt loggen
console.log('🍪 CookieJar Inhalt:', JSON.stringify(cookieJar.toJSON(), null, 2));
try {
if (!agrarmonitorId || !pcName) {
console.error('❌ AgrarmonitorID oder PC-Name fehlt');