Skip to content

Commit 4a6420c

Browse files
authored
Merge pull request #20 from zenstackhq/dev
dev to main
2 parents def99f3 + e13091f commit 4a6420c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/proxy",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "A CLI tool to run an Express server that proxies CRUD requests to a ZenStack backend",
55
"main": "index.js",
66
"publishConfig": {

src/zmodel-parser.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function loadPrismaConfig(schemaDir: string): string | null {
7575
const config = configFn(env)
7676
return config?.datasource?.url
7777
} catch (error) {
78-
if (error instanceof Error && error.message.includes('Environment variable')) {
78+
if (error instanceof Error) {
7979
throw error
8080
}
8181
console.warn(`Warning: Failed to parse prisma.config.ts: ${error}`)
@@ -132,6 +132,9 @@ function parseDatasource(
132132
const urlFn = new Function('env', `return ${urlValueStr}`)
133133
url = urlFn(env)
134134
} catch (evalError) {
135+
if (evalError instanceof CliError) {
136+
throw evalError
137+
}
135138
throw new CliError(
136139
'Could not evaluate datasource url from schema, you could provide it via -d option.'
137140
)
@@ -141,7 +144,7 @@ function parseDatasource(
141144
// If still no URL found, throw error
142145
if (url == null) {
143146
throw new CliError(
144-
'No datasource URL found. For Prisma 7, ensure prisma.config.ts exists with datasource configuration, or provide the URL via -d option.'
147+
'No datasource URL found. For Prisma 7, ensure prisma.config.ts exists with datasource configuration or directly provide the URL via -d option.'
145148
)
146149
}
147150
}

0 commit comments

Comments
 (0)