diff --git a/lib/index.js b/lib/index.js index bc8f3b2..8cb993e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -563,8 +563,8 @@ function initDB(peer, config) { // prettier-ignore if (err) return cb(new Error('add() failed to remove ghost', { cause: err })) logAppend(msgID, msg, (err, rec) => { - if (err) - return cb(new Error('add() failed in the log', { cause: err })) + // prettier-ignore + if (err) return cb(new Error('add() failed in the log', { cause: err })) const doneable = msgsBeingAdded.get(msgID) msgsBeingAdded.delete(msgID) queueMicrotask(() => { diff --git a/lib/msg-v4/tangle.js b/lib/msg-v4/tangle.js index ff3373f..af50e60 100644 --- a/lib/msg-v4/tangle.js +++ b/lib/msg-v4/tangle.js @@ -145,7 +145,7 @@ class Tangle { */ topoSort() { if (!this.#rootMsg) { - console.trace('Tangle is missing root message') + console.trace(`Tangle "${this.#rootID}" is missing root message`) return [] } const sorted = [] @@ -164,7 +164,7 @@ class Tangle { */ get tips() { if (!this.#rootMsg) { - console.trace('Tangle is missing root message') + console.trace(`Tangle "${this.#rootID}" is missing root message`) return new Set() } return this.#tips @@ -176,7 +176,7 @@ class Tangle { */ getLipmaaSet(depth) { if (!this.#rootMsg) { - console.trace('Tangle is missing root message') + console.trace(`Tangle "${this.#rootID}" is missing root message`) return new Set() } const lipmaaDepth = lipmaa(depth + 1) - 1 @@ -201,7 +201,7 @@ class Tangle { #isFeed() { if (!this.#rootMsg) { - console.trace('Tangle is missing root message') + console.trace(`Tangle "${this.#rootID}" is missing root message`) return false } return isMoot(this.#rootMsg) @@ -214,7 +214,7 @@ class Tangle { get mootDetails() { if (!this.#isFeed()) return null if (!this.#rootMsg) { - console.trace('Tangle is missing root message') + console.trace(`Tangle "${this.#rootID}" is missing root message`) return null } const { account, domain } = this.#rootMsg.metadata @@ -226,7 +226,7 @@ class Tangle { */ get type() { if (!this.#rootMsg) { - throw new Error('Tangle is missing root message') + throw new Error(`Tangle "${this.#rootID}" is missing root message`) } if (this.#isFeed()) return 'feed' if (this.#rootMsg.metadata.account === 'self') return 'account' @@ -245,7 +245,7 @@ class Tangle { */ shortestPathToRoot(msgID) { if (!this.#rootMsg) { - console.trace('Tangle is missing root message') + console.trace(`Tangle "${this.#rootID}" is missing root message`) return [] } const path = [] @@ -301,7 +301,7 @@ class Tangle { */ precedes(msgAID, msgBID) { if (!this.#rootMsg) { - console.trace('Tangle is missing root message') + console.trace(`Tangle "${this.#rootID}" is missing root message`) return false } if (msgAID === msgBID) return false