mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-02 12:54:32 +00:00
* feat(serve): add workspace MCP management * fix(serve): refine workspace MCP management * fix(web-shell): align MCP action expectation * fix(serve): address MCP review findings --------- Co-authored-by: 钉萁 <dingqi.jww@alibaba-inc.com> Co-authored-by: Shaojin Wen <shaojin.wensj@alibaba-inc.com> Co-authored-by: qwen-code-dev-bot <qwen-code-dev-bot@users.noreply.github.com> Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
16 lines
683 B
TypeScript
16 lines
683 B
TypeScript
export function extractErrorDetail(error: unknown): string {
|
|
if (error && typeof error === 'object') {
|
|
const body = (error as { body?: unknown }).body;
|
|
if (body && typeof body === 'object') {
|
|
const data = (body as { data?: unknown }).data;
|
|
if (data && typeof data === 'object') {
|
|
const details = (data as { details?: unknown }).details;
|
|
if (typeof details === 'string' && details) return details;
|
|
}
|
|
const bodyError = (body as { error?: unknown }).error;
|
|
if (typeof bodyError === 'string' && bodyError) return bodyError;
|
|
}
|
|
if (error instanceof Error && error.message) return error.message;
|
|
}
|
|
return String(error);
|
|
}
|