MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / display_api_error

Method display_api_error

codewiki/cli/utils/api_errors.py:89–111  ·  view source on GitHub ↗

Display API error with formatting. Args: error: The API error module_name: Optional module name for context

(error: APIError, module_name: Optional[str] = None)

Source from the content-addressed store, hash-verified

87 def display_api_error(error: APIError, module_name: Optional[str] = None):
88 """
89 Display API error with formatting.
90
91 Args:
92 error: The API error
93 module_name: Optional module name for context
94 """
95 click.echo()
96 click.secho("✗ LLM API Error", fg="red", bold=True)
97 click.echo()
98
99 if module_name:
100 click.echo(f"Module: {module_name}")
101 click.echo()
102
103 click.echo(error.message)
104 click.echo()
105 click.secho("Documentation generation stopped. No partial results saved.", fg="yellow")
106 click.echo()
107
108
109def wrap_api_call(func, *args, fail_fast: bool = True, context: Optional[str] = None, **kwargs):
110 """
111 Wrap an API call with error handling.
112
113 Args:
114 func: Function to call

Callers 1

wrap_api_callFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected