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);
}