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:
parent
3adfa3f17c
commit
1c44b48a4c
@ -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 ?? '';
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user