29 lines
683 B
JavaScript
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]);
|
|
});
|