Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[legacy-framework] show an error if model name is invalid in blitz generate #2802

Merged
merged 10 commits into from
Oct 11, 2021
2 changes: 1 addition & 1 deletion packages/cli/src/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class Generate extends Command {
)
}
if (!/^[A-Za-z][A-Za-z0-9_]*$/.test(modelName)) {
throw new Error(`Model name cannot contain any special characters`)
throw new Error(`Invalid model name: ${modelName}. Model names need to adhere to this regular expression: [A-Za-z][A-Za-z0-9_]*`)
beerose marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down