fix: replace console usage with logger, throw on unknown reactor type

Unknown reactor type is a configuration error that should fail loudly.
Converted console.log to logger.warn for unknown topics.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Rene De Ren
2026-03-12 09:33:34 +01:00
parent 7ff7c6ec1d
commit 06251988af

View File

@@ -57,7 +57,7 @@ class nodeClass {
break;
}
default:
console.log("Unknown topic: " + msg.topic);
this.source.logger.warn(`Unknown topic: ${msg.topic}`);
}
if (done) {
@@ -129,7 +129,7 @@ class nodeClass {
new_reactor = new Reactor_PFR(this.config);
break;
default:
console.warn("Unknown reactor type: " + this.config.reactor_type);
throw new Error(`Unknown reactor type: ${this.config.reactor_type}`);
}
this.source = new_reactor; // protect from reassignment