xtr_cli.exception ¶
Every error this library raises.
All of them derive from :class:CliError, so one except catches anything
scaffolding a project can go wrong with, and a narrower one handles a single
cause.
AmbiguousWebEntryPointError ¶
CliError ¶
Bases: Exception
Base class for every error raised by this library.
Catch this to handle anything scaffolding a project can go wrong with; catch a subclass to handle one cause. Every subclass carries what went wrong as typed attributes and composes its own message from them.
DirectoryNotEmptyError ¶
Bases: CliError
The directory to scaffold into is a file, or already holds files.
Nothing is ever written over: a project starts in a directory that is missing or holds nothing but version-control and editor metadata.
Attributes:
-
directory(Path) –The directory asked for.
-
found(tuple[str, ...]) –The entries that are in the way, sorted.
Record the directory and what is already in it.
InvalidProjectNameError ¶
Bases: CliError
The name asked for, or the directory it was read from, cannot name the project.
The name becomes the distribution, the console script and — dashes turned
into underscores — the import package under src/. A name that is not a
valid identifier once turned, is a keyword, or would shadow a module of the
standard library would leave an application that cannot import itself.
Attributes:
Record the name and why it was refused.
InvalidTemplateError ¶
ProjectNotFoundError ¶
StepFailedError ¶
Bases: CliError
One of the commands that finish a project failed; the rest were not run.
The command has already said why on its own streams. What it left behind is kept: the files written so far are the project, and running the remaining commands by hand — or deleting the directory — is the way on.
Attributes:
-
argv(tuple[str, ...]) –The command that failed, program and all.
-
cwd(Path) –Where it ran.
-
code(int) –The exit code it ended with.
Record the command, where it ran, and how it ended.