Skip to content

Commit 3256f20

Browse files
committed
fix: update TypeScript configuration to target ES2022 and enhance error handling with cause property
1 parent 9037a50 commit 3256f20

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/server/src/utils/buildAgentflow.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ const executeNode = async ({
12511251
const errorStatus = isAborted ? 'TERMINATED' : 'ERROR'
12521252
const errorMessage = isAborted ? 'Flow execution was cancelled' : getErrorMessage(error)
12531253
status = errorStatus
1254-
throw new Error(errorMessage)
1254+
throw new Error(errorMessage, { cause: error })
12551255
}
12561256
}
12571257
}
@@ -1826,7 +1826,7 @@ export const executeAgentFlow = async ({
18261826
const errorMessage = isAborted ? 'Flow execution was cancelled' : getErrorMessage(error)
18271827
status = errorStatus
18281828
// ... existing error handling code
1829-
throw new Error(errorMessage)
1829+
throw new Error(errorMessage, { cause: error })
18301830
}
18311831
}
18321832

packages/server/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
3-
"lib": ["es2021"],
4-
"target": "es2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
3+
"lib": ["es2022"],
4+
"target": "es2022" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
55
"experimentalDecorators": true /* Enable experimental support for TC39 stage 2 draft decorators. */,
66
"emitDecoratorMetadata": true /* Emit design-type metadata for decorated declarations in source files. */,
77
"module": "commonjs" /* Specify what module code is generated. */,

0 commit comments

Comments
 (0)