Files
f6960096f3 Enable strict TypeScript, add errorMessage helper (#37292)
Enable full TypeScript `strict` mode and fix issues discovered during
this refactor. Introduced a `errorMessage` helper function to cleanly
extract a error messages from the `unknown` type.

Signed-off-by: silverwind <[email protected]>
Co-authored-by: Claude (claude-opus-4-7) <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
2026-04-20 07:22:05 +00:00

11 lines
396 B
TypeScript

import {errorMessage} from '../modules/errors.ts';
export function displayError(el: Element, err: unknown): void {
el.classList.remove('is-loading');
const errorNode = document.createElement('pre');
errorNode.setAttribute('class', 'ui message error markup-block-error');
errorNode.textContent = errorMessage(err);
el.before(errorNode);
el.setAttribute('data-render-done', 'true');
}