You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After throwing a NonRetriableError with a cause property, In the object passed to onFailure:
event.data.error.cause is not populated.
result.causeis populated but the handler type does not surface result as a property that exists.
To Reproduce
Steps to reproduce the behavior:
Create a function with an onFailure handler:
constinngestFn=inngest.createFunction({id: 'some-function',onFailure: async({ event, env })=>{consteventData=event.data;constinputEvent=event.data.event;constinputEventData=inputEvent.data;constoutput={expectedEventErrorCauseMessage: inputEventData.message,actualEventErrorCauseMessage: eventData.error.cause??null,// @ts-expect-error for some reason `result` is not in the typeactualResultCauseMessage: eventData.result?.cause?.message,};returnoutput;},},{event: 'app/some-event'},async({ event, step })=>{thrownewNonRetriableError('Some inngest error',{cause: {message: event.data.message},// new Error(event.data.message) doesn't work either});},);
Describe the bug
After throwing a
NonRetriableError
with acause
property, In the object passed toonFailure
:event.data.error.cause
is not populated.result.cause
is populated but the handler type does not surfaceresult
as a property that exists.To Reproduce
Steps to reproduce the behavior:
onFailure
handler:onFailure
handler:MRE repository here
Expected behavior
In the above reproduction:
actualEventErrorCauseMessage
should equalsome error message
.result
property in the object passed to theonFailure
handler.System info (please complete the following information):
14.4.1
3.29.0
1.3.3
The text was updated successfully, but these errors were encountered: