mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(user-menu) improve error handling
This commit is contained in:
parent
b8592d35c0
commit
64e6b8387a
5 changed files with 109 additions and 14 deletions
|
|
@ -72,13 +72,16 @@ async function onGET({req, res, menuName}) {
|
|||
if (parseError)
|
||||
return res
|
||||
.type('js')
|
||||
.send(`
|
||||
throw Error(\`<pre>path: ${menuPath}\n\n${codeframe({
|
||||
error: parseError,
|
||||
source,
|
||||
highlightCode: false,
|
||||
})}
|
||||
.send(`const e = Error(\`<pre>path: ${menuPath}\n\n${codeframe({
|
||||
error: parseError,
|
||||
source,
|
||||
highlightCode: false,
|
||||
})}
|
||||
</pre>\`);
|
||||
|
||||
e.code = 'frame';
|
||||
|
||||
throw e;
|
||||
`);
|
||||
|
||||
res
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue