fix: replace TRPCClientError with more user-friendly msg#5347
Conversation
🤖 My Senior Dev — Analysis Complete👤 For @TBonnin📁 Expert in View your contributor analytics → 📊 3 files reviewed • 3 need attention
🚀 Open Interactive Review →The full interface unlocks features not available in GitHub:
💬 Chat here: 📖 View all 12 personas & slash commandsYou can interact with me by mentioning In PR comments or on any line of code:
Slash commands:
AI Personas (mention to get their perspective):
For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews. |
| }); | ||
|
|
||
| if (!script) { | ||
| const content = `Unable to find integration file for ${nangoProps.syncConfig.sync_name}`; |
There was a problem hiding this comment.
unrelated but consolidating all the error handling in the trycatch below which fixes some inconsistencies like always setting the logCtx and span error or returning different shape of errors.
| const runtimeAdapter = await getRuntimeAdapter({ nangoProps, runtimeContext }); | ||
| if (runtimeAdapter.isErr()) { | ||
| return Err(runtimeAdapter.error); | ||
| throw runtimeAdapter.error; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| }); | ||
| await client.send(command); | ||
| return Ok(true); | ||
| } catch (err) { |
There was a problem hiding this comment.
also handling the AWS lambda specific error
Improve runtime adapter error messaging for job execution
Wraps Lambda and runner runtime invocations in try/catch blocks so low-level
TRPCClientErrorinstances are converted into clearerErrormessages before propagating through the job pipeline. ThestartScriptoperation now throws immediately on missing scripts, missing teams, adapter resolution failures, or adapter invoke errors, ensuring downstream callers receive explicit exceptions rather than opaqueErrstrings.Key Changes
• Made
LambdaRuntimeAdapter.getFunctionprivate and wrappedinvokein a try/catch that returnsErr(new Error('Lambda was unable to execute the function', { cause: err }))when AWS invocation fails• Added try/catch around
RunnerRuntimeAdapter.invoketo convert runner client failures intoErr(new Error('Nango runner was unable to execute the function', { cause: err }))• Updated
startScriptto throw on missing script/team data, throw adapter errors directly, rethrow failed runtime invocations, and log a consistentError starting function ...message before returningErr(errMessage)Affected Areas
• packages/jobs/lib/runtime/lambda.adapter.ts
• packages/jobs/lib/runtime/runner.adapter.ts
• packages/jobs/lib/execution/operations/start.ts
This summary was automatically generated by @propel-code-bot