MCPcopy Create free account
hub / github.com/alibaba/lowcode-engine / getErrorMessage

Function getErrorMessage

modules/code-generator/src/utils/errors.ts:4–26  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

2 * 获取错误信息
3 */
4export function getErrorMessage(error: unknown): string | null {
5 if (!error) {
6 return null;
7 }
8
9 if (error instanceof Error) {
10 return error.message;
11 }
12
13 if (typeof error === 'string') {
14 return error;
15 }
16
17 if (typeof error === 'object' && error !== null) {
18 return (
19 getErrorMessage((error as { message: string }).message) ||
20 getErrorMessage((error as { errorMessage: string }).errorMessage) ||
21 getErrorMessage((error as { detail: string }).detail)
22 );
23 }
24
25 return null;
26}

Callers 7

publishFunction · 0.90
publishFunction · 0.90
decodeSchemaMethod · 0.90
initSolutionFunction · 0.90
runFunction · 0.90
getNpmDependenciesFunction · 0.90
errors.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…