Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 5 additions & 2 deletions src/zmodel-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function loadPrismaConfig(schemaDir: string): string | null {
const config = configFn(env)
return config?.datasource?.url
} catch (error) {
if (error instanceof Error && error.message.includes('Environment variable')) {
if (error instanceof Error) {
throw error
}
console.warn(`Warning: Failed to parse prisma.config.ts: ${error}`)
Expand Down 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 All @@ -141,7 +144,7 @@ function parseDatasource(
// If still no URL found, throw error
if (url == null) {
throw new CliError(
'No datasource URL found. For Prisma 7, ensure prisma.config.ts exists with datasource configuration, or provide the URL via -d option.'
'No datasource URL found. For Prisma 7, ensure prisma.config.ts exists with datasource configuration or directly provide the URL via -d option.'
)
}
}
Expand Down