framework: show step error detail

This commit is contained in:
undefined committed 2025-03-11 14:13:02 +08:00
1 parent 0414a1300b
commit 51c3c4f30f
3 files changed
+3 -6

No files matched your search

+1 -1
View File
@@ -528,7 +528,7 @@ ${c.response.status} ${endTime - startTime}ms ${c.response.length}`);
else if (typeof h[step] === 'function') control = await h[step](args);
if (control) {
const index = steps.findIndex((i) => control === i);
if (index === -1) throw new Error(`Invalid control: ${control}`);
if (index === -1) throw new Error(`Invalid control: ${control} (after step ${step})`);
if (index <= current) {
logger.warn('Returning to previous step is not recommended:', step, '->', control);
}
@@ -1,9 +1,6 @@
// https://github.com/waylonflinn/markdown-it-katex/blob/master/index.js
import { Logger } from 'hydrooj';
import katex from 'katex';
const logger = new Logger('katex');
function isValidDelim(state, pos) {
const max = state.posMax;
const prevChar = pos > 0 ? state.src.charCodeAt(pos - 1) : -1;
@@ -118,7 +115,7 @@ export default function plugin(md) {
latex = latex.replace(/\\def{\\([a-zA-Z0-9]+)}/g, '\\def\\$1');
return katex.renderToString(latex, options);
} catch (error) {
if (options.throwOnError) logger.error(error);
if (options.throwOnError) console.error(error);
return `<p class='${displayMode ? 'katex-block ' : ''}katex-error' title='${escapeHtml(error.toString())}'>${escapeHtml(latex)}</p>`;
}
};
+1 -1
View File
@@ -1,3 +1,3 @@
declare module '*.vue' {
export default {} as any;
export default {} as any;
}