mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
feature(user-menu) rm path
This commit is contained in:
parent
98e284074c
commit
57984fe2d6
1 changed files with 15 additions and 11 deletions
|
|
@ -72,23 +72,27 @@ async function onGET({req, res, menuName}) {
|
|||
if (parseError)
|
||||
return res
|
||||
.type('js')
|
||||
.send(`const e = Error(\`<pre>path: ${menuPath}\n\n${codeframe({
|
||||
error: parseError,
|
||||
source,
|
||||
highlightCode: false,
|
||||
})}
|
||||
</pre>\`);
|
||||
|
||||
e.code = 'frame';
|
||||
|
||||
throw e;
|
||||
`);
|
||||
.send(getError(parseError, source));
|
||||
|
||||
res
|
||||
.type('js')
|
||||
.send(result.code);
|
||||
}
|
||||
|
||||
function getError(parseError, source) {
|
||||
return `
|
||||
const e = Error(\`<pre>${codeframe({
|
||||
error: parseError,
|
||||
source,
|
||||
highlightCode: false,
|
||||
})}</pre>\`);
|
||||
|
||||
e.code = 'frame';
|
||||
|
||||
throw e;
|
||||
`;
|
||||
}
|
||||
|
||||
function sendDefaultMenu(res) {
|
||||
res.sendFile(DEFAULT_MENU_PATH, {
|
||||
cacheControl: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue