Skip to content

Commit eb580b4

Browse files
authored
Merge pull request #74 from Ontos-AI/fix/wangbinqi/unwrap-upstash-errors
Log real Upstash trigger errors before Effect hides them
2 parents f2f2752 + 39c8535 commit eb580b4

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

src/domains/sources/background-reconcile.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,24 @@ const startBackgroundReconciliationEffect = (
4848
workspaceId,
4949
url,
5050
})
51-
yield* Effect.tryPromise(() =>
52-
new Client({ token }).trigger({
53-
url,
54-
body: { workspaceId, sourceId, apiKey },
55-
workflowRunId: sourceId,
56-
retries: 3,
57-
}),
58-
)
51+
yield* Effect.tryPromise(async () => {
52+
try {
53+
return await new Client({ token }).trigger({
54+
url,
55+
body: { workspaceId, sourceId, apiKey },
56+
workflowRunId: sourceId,
57+
retries: 3,
58+
})
59+
} catch (err) {
60+
logger.error("background-reconcile: Upstash trigger threw", {
61+
sourceId,
62+
workspaceId,
63+
message: err instanceof Error ? err.message : String(err),
64+
stack: err instanceof Error ? err.stack : undefined,
65+
})
66+
throw err
67+
}
68+
})
5969
yield* Effect.logInfo(
6070
`background-reconcile: workflow triggered for ${sourceId}`,
6171
)

0 commit comments

Comments
 (0)