MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / print_error

Function print_error

unity_cli/cli/output.py:237–259  ·  view source on GitHub ↗

Print error message to stderr. Args: message: Error message (will be escaped to prevent markup injection) code: Optional error code

(message: str, code: str | None = None)

Source from the content-addressed store, hash-verified

235
236
237def print_error(message: str, code: str | None = None) -> None:
238 """Print error message to stderr.
239
240 Args:
241 message: Error message (will be escaped to prevent markup injection)
242 code: Optional error code
243 """
244 if err_console.no_color:
245 print(f"Error: {message}", file=sys.stderr)
246 if code:
247 print(f"Code: {code}", file=sys.stderr)
248 return
249
250 text = Text()
251 text.append("Error: ", style="bold red")
252 text.append(escape(message)) # Escape untrusted content
253 err_console.print(text)
254
255 if code:
256 code_text = Text()
257 code_text.append("Code: ", style="dim")
258 code_text.append(escape(code), style="yellow") # Escape untrusted content
259 err_console.print(code_text)
260
261
262def print_validation_error(message: str, help_command: str) -> None:

Callers 14

_handle_errorFunction · 0.90
config_initFunction · 0.90
recorder_startFunction · 0.90
build_runFunction · 0.90
project_packagesFunction · 0.90
project_tagsFunction · 0.90
project_qualityFunction · 0.90
project_assembliesFunction · 0.90
_captureFunction · 0.90
_burstFunction · 0.90

Calls

no outgoing calls

Tested by 2