Closed aabedraba closed 1 year ago
With normal functions I'm using the logger this way:
logger
async ({ event, step, logger }) => { await step.run("Trigger task", async () => { try { return await task() } catch (err) { logger.error("Step Trigger upload event failed: ", { userId: event.data.userId }); throw err; } }); }
Nevertheless, I don't get a logger on the onFailure section as it's not available, so I would need to do my error handling differently in different places, which is not ideal.
Is there a reason it was designed this way? Would be great to have it!
Thanks for catching this, @aabedraba! Will be fixed in the next release:
With normal functions I'm using the
logger
this way:Nevertheless, I don't get a
logger
on the onFailure section as it's not available, so I would need to do my error handling differently in different places, which is not ideal.Is there a reason it was designed this way? Would be great to have it!