1
0
Fork 0
mirror of synced 2024-10-03 10:36:59 +13:00

Tell a user if their JS failed due to a timeout.

This commit is contained in:
Sam Rose 2023-12-15 16:27:20 +00:00
parent f1263eeae4
commit 92a230667f
No known key found for this signature in database

View file

@ -56,6 +56,9 @@ module.exports.processJS = (handlebars, context) => {
const res = { data: runJS(js, sandboxContext) } const res = { data: runJS(js, sandboxContext) }
return `{{${LITERAL_MARKER} js_result-${JSON.stringify(res)}}}` return `{{${LITERAL_MARKER} js_result-${JSON.stringify(res)}}}`
} catch (error) { } catch (error) {
if (error.code === "ERR_SCRIPT_EXECUTION_TIMEOUT") {
return "Timed out while executing JS"
}
return "Error while executing JS" return "Error while executing JS"
} }
} }