(errString: string)
| 503 | }; |
| 504 | |
| 505 | const strToError = (errString: string): SerializableError => { |
| 506 | const {message, stack} = separateMessageFromStack(errString); |
| 507 | if (stack.length > 0) { |
| 508 | return {message, stack}; |
| 509 | } |
| 510 | const error = new ErrorWithStack(message, buildExecError); |
| 511 | return {message, stack: error.stack || ''}; |
| 512 | }; |
| 513 | |
| 514 | const buildExecError = (err: unknown): SerializableError => { |
| 515 | if (typeof err === 'string' || err == null) { |
no test coverage detected