0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-05-11 04:55:34 +02:00

Add TSDoc to errorMessage and errorName helpers

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
This commit is contained in:
silverwind 2026-05-04 22:36:51 +02:00
parent 3adfa3f17c
commit 1c44b48a4c
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443

View File

@ -2,10 +2,12 @@
import {html} from '../utils/html.ts';
import type {Intent} from '../types.ts';
/** Extract a message string from an unknown caught value. */
export function errorMessage(err: unknown): string {
return (err as Error)?.message || String(err);
}
/** Extract a name string from an unknown caught value. */
export function errorName(err: unknown): string {
return (err as Error)?.name ?? '';
}