|
|
|
@ -198,6 +198,7 @@ Meta.commands = Object.keys(commands);
|
|
|
|
|
Meta.createLineHandler = function (ref, errorHandler) {
|
|
|
|
|
ref.meta = {};
|
|
|
|
|
ref.index = 0;
|
|
|
|
|
ref.logged = {};
|
|
|
|
|
|
|
|
|
|
return function (err, line) {
|
|
|
|
|
if (err) {
|
|
|
|
@ -216,10 +217,15 @@ Meta.createLineHandler = function (ref, errorHandler) {
|
|
|
|
|
var index = ref.index++;
|
|
|
|
|
if (typeof(line) === 'undefined') { return; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Array.isArray(line)) {
|
|
|
|
|
try {
|
|
|
|
|
handleCommand(ref.meta, line);
|
|
|
|
|
} catch (err2) {
|
|
|
|
|
var code = err2.message;
|
|
|
|
|
if (ref.logged[code]) { return; }
|
|
|
|
|
|
|
|
|
|
ref.logged[code] = true;
|
|
|
|
|
errorHandler("METADATA_COMMAND_ERR", {
|
|
|
|
|
error: err2.stack,
|
|
|
|
|
line: line,
|
|
|
|
|