mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 09:14:58 +00:00
10 lines
288 B
TypeScript
10 lines
288 B
TypeScript
/**
|
|
* Returns an appropriate message for the error.
|
|
*
|
|
* If the error is an `Error` instance, this returns the error message without
|
|
* an `Error: ` prefix.
|
|
*/
|
|
export function getErrorMessage(error: unknown): string {
|
|
return error instanceof Error ? error.message : String(error);
|
|
}
|