()
| 391 | } |
| 392 | |
| 393 | toJSON(): { code: number; index: number; errmsg?: string; op: Document } { |
| 394 | return { code: this.err.code, index: this.err.index, errmsg: this.err.errmsg, op: this.err.op }; |
| 395 | } |
| 396 | |
| 397 | toString(): string { |
| 398 | return `WriteError(${JSON.stringify(this.toJSON())})`; |