MCPcopy
hub / github.com/zenml-io/zenml / error

Function error

src/zenml/cli/utils.py:194–212  ·  view source on GitHub ↗

Echo an error string on the CLI. Args: text: Input text string. Raises: StyledClickException: when called.

(text: str)

Source from the content-addressed store, hash-verified

192
193
194def error(text: str) -> NoReturn:
195 """Echo an error string on the CLI.
196
197 Args:
198 text: Input text string.
199
200 Raises:
201 StyledClickException: when called.
202 """
203 error_prefix = click.style("Error: ", fg="red", bold=True)
204 error_message = click.style(text, fg="red", bold=False)
205
206 class StyledClickException(click.ClickException):
207 def show(self, file: Optional[IO[Any]] = None) -> None:
208 if file is None:
209 file = click.get_text_stream("stderr")
210 click.echo(self.message, file=file)
211
212 raise StyledClickException(message=error_prefix + error_message)
213
214
215def exception(exception: Exception) -> NoReturn:

Callers 15

featureFunction · 0.90
export_requirementsFunction · 0.90
installFunction · 0.90
uninstallFunction · 0.90
upgradeFunction · 0.90
create_secretFunction · 0.90
list_secretsFunction · 0.90
_get_secretFunction · 0.90
update_secretFunction · 0.90
rename_secretFunction · 0.90
delete_secretFunction · 0.90
backup_secretsFunction · 0.90

Calls 1

Tested by

no test coverage detected