qwen-code/packages/web-shell/client/utils/errorDetail.ts
ytahdn 4bc31cb608
feat(serve): add workspace MCP management (#6954)
* 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>
2026-07-16 02:24:07 +00:00

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);
}