1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2024-11-22 16:17:29 +00:00

When data not initialised, log more details

This commit is contained in:
Cadence Ember 2020-07-29 00:10:27 +12:00
parent 942b18ef21
commit 4c119c307b
No known key found for this signature in database
GPG Key ID: 128B99B1B74A6412

View File

@ -21,7 +21,11 @@ class TimelineEntry extends TimelineBaseMethods {
this.data = {} this.data = {}
const error = new Error("TimelineEntry data was not initalised in same event loop (missing __typename)") // initialise here for a useful stack trace const error = new Error("TimelineEntry data was not initalised in same event loop (missing __typename)") // initialise here for a useful stack trace
setImmediate(() => { // next event loop setImmediate(() => { // next event loop
if (!this.data.__typename) throw error if (!this.data.__typename) {
console.error("Event loop passed. Current data:")
console.error(this.data)
throw error
}
}) })
/** @type {string} Not available until fetchExtendedOwnerP is called */ /** @type {string} Not available until fetchExtendedOwnerP is called */
this.ownerPfpCacheP = null this.ownerPfpCacheP = null