Skip to content

NaN needs to be handled here, otherwise JSON.stringfly will convert NaN to null below #1187

@mming-01

Description

@mming-01

serialise() { const logData = this.data.map((e) => { // JSON.stringify(new Error('test')) returns {}, which is not really useful for us. // The following allows us to serialize errors correctly. if (e && e.message && e.stack) { e = Object.assign({ message: e.message, stack: e.stack }, e); } if(isNaN(e) && typeof e === 'number') { e = 'NaN' } return e; }); this.data = logData; return flatted.stringify(this); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions