winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.73k stars 185 forks source link

Errors thrown in `Queue.setConsumer` are mysteriously dropped #6445

Open Chriscbr opened 1 month ago

Chriscbr commented 1 month ago

I tried this:

Throwing an error in my setConsumer handler:

bring cloud;

let queue = new cloud.Queue();
queue.setConsumer(inflight () => {
  log("hey");
  throw "ah!";
});

This happened:

No error is logged in the Wing Console

Screenshot 2024-05-08 at 8 52 15 PM

I expected this:

Errors to be surfaced

Is there a workaround?

Add a DLQ or log the errors instead

Anything else?

No response

Wing Version

0.73.35

Node.js Version

No response

Platform(s)

No response

Community Notes

Chriscbr commented 1 month ago

See https://github.com/winglang/wing/blob/f1e42615244812ffb4ef1322c2b7c594942a8e87/libs/wingsdk/src/target-sim/queue.ts#L167-L172