Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/proxy",
"version": "0.2.3",
"version": "0.2.4",
"description": "A CLI tool to run an Express server that proxies CRUD requests to a ZenStack backend",
"main": "index.js",
"publishConfig": {
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ export default async function () {
// ignore
exitCode = e.exitCode
} else if (e instanceof CliError) {
telemetry.trackError(e)
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The error is being tracked twice for CliError instances. The trackCli wrapper already tracks errors via trackSpan (line 116 in telemetry.ts), which calls track('proxy:error') in its catch block. This duplicate tracking will result in two error events being sent to telemetry for the same error.

Suggested change
telemetry.trackError(e)
// telemetry for CliError is already handled by telemetry.trackCli

Copilot uses AI. Check for mistakes.
console.error(red(e.message))
} else {
if (e instanceof Error) {
telemetry.trackError(e)
console.error(red(`Unhandled error: ${e.message}`))
} else {
telemetry.trackError(new Error(String(e)))
console.error(red(`Unhandled error: ${String(e)}`))
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/zmodel-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ function parseDatasource(
const urlFn = new Function('env', `return ${urlValueStr}`)
url = urlFn(env)
} catch (evalError) {
if (evalError instanceof CliError) {
throw evalError
}
throw new CliError(
'Could not evaluate datasource url from schema, you could provide it via -d option.'
)
Expand Down
Loading