ignore successive metadata errors with the same message

pull/1/head
ansuz 5 years ago
parent 2cceb54aac
commit 33c12c27a1

@ -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,

Loading…
Cancel
Save