Skip to content

Commit

Permalink
catch error
Browse files Browse the repository at this point in the history
  • Loading branch information
hrgdavor committed Mar 14, 2024
1 parent 4b9d697 commit aca2807
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions apps/jscad-web/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,14 @@ function trackJobs(jobs) {
const runScript = async ({ script, url = './jscad.model.js', base = currentBase, root }) => {
currentBase = base
loadDefault = false // don't load default model if something else was loaded
const result = await workerApi.runScript({ script, url, base, root, smooth: viewState.smoothRender })
genParams({ target: byId('paramsDiv'), params: result.def || {}, callback: paramChangeCallback })
lastRunParams = result.params
handlers.entities(result)
try{
const result = await workerApi.runScript({ script, url, base, root, smooth: viewState.smoothRender })
genParams({ target: byId('paramsDiv'), params: result.def || {}, callback: paramChangeCallback })
lastRunParams = result.params
handlers.entities(result)
}catch(err){
setError(err)
}
}

const bundles = {
Expand Down
3 changes: 2 additions & 1 deletion apps/jscad-web/online.editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Any text or code editor will work for this (vi, vim, neovim, notepad++, VSCodium
- edit the file, save the changes, jscad.app will automatically re-run the script

A chromium based browser is required, as other browser do not allow JS to see changes to the file.
Firefox plays dumb and will indefinitely give the initial file version, even after it changes on your drive.

## Enthusiast: a multifile project

Expand Down Expand Up @@ -42,7 +43,7 @@ I personally prefer to use VSCode and drag/drop my file onto jscad.app to see it
any editor
drag and dropping file to openjscad or jscad.app will cause it to be given to the browser with permission to read it.
You must use Chrome for jscad to be able to check few times a second to see if it changed
Only Chrome can get change info and read new content ... Firefox plays dumb and will indefinitely give the initial file version, even after it chanes on your drive
Only Chrome can get change info and read new content ...



0 comments on commit aca2807

Please sign in to comment.