(e: unknown)
| 190 | |
| 191 | @autobind |
| 192 | private handleError(e: unknown): void { |
| 193 | if (!this.opts.err) throw e; |
| 194 | if (this.opts.abortOnError) { |
| 195 | // when abortOnError is true, error handler should be called only once |
| 196 | if (this.stop) return; |
| 197 | this.abort(); |
| 198 | } |
| 199 | if (e instanceof AiScriptError) { |
| 200 | this.opts.err(e); |
| 201 | } else { |
| 202 | this.opts.err(new NonAiScriptError(e)); |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | @autobind |
| 207 | private log(type: string, params: LogObject): void { |