(email: string, body: string)
| 62 | worker.start() |
| 63 | |
| 64 | function sendEmail(email: string, body: string) { |
| 65 | if (body === "Error") { |
| 66 | console.log(`Error sending email to ${email}`) |
| 67 | throw new Error("Simulated error") |
| 68 | } |
| 69 | return new Promise(resolve => setTimeout(resolve, 1000)) |
| 70 | } |