Skip to content

Commit

Permalink
Clarify Invalid App Name Error (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraftp authored Nov 14, 2024
1 parent b91d8db commit eaa9107
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dbos/_dbos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def load_config(config_file_path: str = "dbos-config.yaml") -> ConfigFile:

if not _is_valid_app_name(data["name"]):
raise DBOSInitializationError(
f'Invalid app name {data["name"]}. App names must be between 3 and 30 characters and contain only alphanumeric characters, dashes, and underscores.'
f'Invalid app name {data["name"]}. App names must be between 3 and 30 characters long and contain only lowercase letters, numbers, dashes, and underscores.'
)

if "app_db_name" not in data["database"]:
Expand Down
4 changes: 3 additions & 1 deletion dbos/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ def init(
)

if not _is_valid_app_name(project_name):
raise Exception(f"{project_name} is an invalid DBOS app name")
raise Exception(
f"{project_name} is an invalid DBOS app name. App names must be between 3 and 30 characters long and contain only lowercase letters, numbers, dashes, and underscores."
)

templates_dir = _get_templates_directory()
templates = [x.name for x in os.scandir(templates_dir) if x.is_dir()]
Expand Down

0 comments on commit eaa9107

Please sign in to comment.