events module
This commit is contained in:
parent
f0863b517a
commit
6e9e666e19
28
bin/events/module.js
Normal file
28
bin/events/module.js
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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]);
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user