refactor(error): refactor standard throws to non-retryable ApplicationFailure in workflows and activities

This commit is contained in:
yiling
2026-05-28 10:43:54 +08:00
parent afeb5e9899
commit 023f256e00
7 changed files with 71 additions and 14 deletions
+3 -1
View File
@@ -211,7 +211,9 @@ export async function createCommentActivity(params: CreateCommentParams) {
where: { id: params.assetId },
include: { project: true },
})
if (!asset || !asset.project) throw new Error('asset or project not found')
if (!asset || !asset.project) {
throw ApplicationFailure.create({ message: 'asset or project not found', nonRetryable: true })
}
const teamId = asset.project.teamId
// Ensure user exists for agent