@rws-framework/client
Version:
This package provides the core client-side framework for Realtime Web Suit (RWS), enabling modular, asynchronous web components, state management, and integration with backend services. It is located in `.dev/client`.
20 lines (18 loc) • 572 B
JavaScript
function html_error_proof(htmlContent){
return `async function handleError(error: Error | any) {
const errorMessage = \`RWS HTML Error:\n\${error.stack}\`;
console.error('RWS HTML error', errorMessage);
return T.html\`<div class="rws-error"><h1>RWS HTML template error</h1>\${errorMessage}</div>\`;
}
try {
//@rws-template-source
rwsTemplate =
T.html\`
${htmlContent}\`;
} catch (error: Error | any) {
rwsTemplate = handleError(error);
}`
}
module.exports = {
html_error_proof
}