Map<String, dynamic> toJson() { return { 'error': this.error?.toString(), 'stack': this.stack?.toString(), }; }