Skip to content

Conversation

@RamK777-stack
Copy link
Contributor

@RamK777-stack RamK777-stack commented Sep 11, 2023

fixes #422 and #159

/claim #159

Currently we are not showing the exact error on trigger.dev web If openAPI request failed. So I am trying to show the exact error and reason for the task failed.

My request failed because of insufficient quota, status code is 429. Unfortunately, both too many requests and insufficient quota are having same status code 429. This is with the background functions.

Previously it was

image

Now I have fixed this like this

image (1)

Note: I didn't test positive flow. because currently, I don't have an active openAI key. I consumed all of my free quota

@changeset-bot
Copy link

changeset-bot bot commented Sep 11, 2023

🦋 Changeset detected

Latest commit: aed1f58

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@matt-aitken matt-aitken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I made it so it falls back to "Task errored" if the task has no output

});

throw new Error(task.error ?? "Task errored");
throw new Error(task.error ?? JSON.stringify(task?.output));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need the fallback "Task errored", if there's no task.output.

Suggested change
throw new Error(task.error ?? JSON.stringify(task?.output));
throw new Error(task.error ?? task?.output ? JSON.stringify(task.output) : "Task errored");

@matt-aitken matt-aitken merged commit bf24593 into triggerdotdev:main Sep 12, 2023
@RamK777-stack RamK777-stack deleted the openAi-retry-config branch October 13, 2023 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TRI-1170] Ensure @trigger.dev/openai background tasks have retry configuration

2 participants