1
0
auth.rxbn.de/bin/events/module.js
2019-06-17 02:44:02 +02:00

29 lines
683 B
JavaScript

/*
* This file is part of the authRXBN single sign-on package.
*
* (c) Ruben Meyer <contact@rxbn.de>
*/
// init
// GCS: Global Communication System
let EventEmitter = require('events');
global['gcs'] = new EventEmitter.EventEmitter();
/**
* Error Message Handler
* @author Ruben Meyer
* @param {String} message data: "MODULE SEPARATOR MESSAGE"
* @return {void}
*/
global['gcs'].on('err', (data) => {
separator = "->";
i = data.indexOf(separator);
parts = [data.slice(0, i), data.slice(i+separator.length)];
for (let a in parts) {
if(parts.hasOwnProperty(a))
parts[a] = parts[a].trim();
}
console.log("ERROR: Module: \""+parts[0]+"\"; Message: "+parts[1]);
});