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
1 changed files with 5 additions and 1 deletions

View File

@ -21,7 +21,11 @@ class TimelineEntry extends TimelineBaseMethods {
this.data = {}
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
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 */
this.ownerPfpCacheP = null