question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unhandled errors using sclang.interpret on Electron

See original GitHub issue

Cannot catch errors raised in the interpreter.

const invalidMessage = "a %%% b"

sclang.interpret(invalidMessage)
 .then(res => res)
 .catch(err => err)

The console outputs this error

[1] TypeError: Cannot read property 'errorString' of null
[1]     at Object.fn (/Users/lorenzo/Developer/Node/superorch/client/node_modules/@supercollider/lang/lib/internals/sclang-io.js:258:113)
[1]     at /Users/lorenzo/Developer/Node/superorch/client/node_modules/@supercollider/lang/lib/internals/sclang-io.js:74:29
[1]     at Array.forEach (<anonymous>)
[1]     at SclangIO.parse (/Users/lorenzo/Developer/Node/superorch/client/node_modules/@supercollider/lang/lib/internals/sclang-io.js:68:33)
[1]     at Socket.<anonymous> (/Users/lorenzo/Developer/Node/superorch/client/node_modules/@supercollider/lang/lib/sclang.js:276:35)
[1]     at Socket.emit (events.js:203:13)
[1]     at addChunk (_stream_readable.js:295:12)
[1]     at readableAddChunk (_stream_readable.js:276:11)
[1]     at Socket.Readable.push (_stream_readable.js:210:10)
[1]     at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
crucialfelixcommented, Jan 30, 2020

1.0.1 is released.

1reaction
crucialfelixcommented, Jan 30, 2020
const sc = require("supercolliderjs");

sc.lang.boot().then(async function(lang) {
  try {
    const ciao = await lang.interpret("ciao");
    console.log(ciao);
  } catch (error) {
    console.error(error);
  }

  await lang.quit();
});
examples ❯ node "/Users/crucialfelix/code/supercolliderjs/examples/lang-error.js"
(node:93586) ExperimentalWarning: The fs.promises API is experimental
SCLangError {
  data: {},
  type: 'SyntaxError',
  error:
   { msg: 'Variable \'ciao\' not defined.',
     file: null,
     line: 1,
     charPos: 4,
     code: 'ciao' } }

fix coming…

Read more comments on GitHub >

github_iconTop Results From Across the Web

sindresorhus/electron-unhandled - GitHub
Catch unhandled errors and promise rejections in your Electron app. You can use this module directly in both the main and renderer process....
Read more >
electron-unhandled - npm
Catch unhandled errors and promise rejections in your Electron app. You can use this module directly in both the main and renderer process....
Read more >
Catch Unhandled Javascript Exception in Electron /w React
Recently, I have been developing an electron app with react. To prevent application from crash when any error occurs, I am supposed to...
Read more >
https://raw.githubusercontent.com/crucialfelix/sup...
SCLang and SCServer can block the command call stack until they've finished booting. ... change: always throw or reject Promises with Error subclass, ......
Read more >
unread related words - RhymeZone
Closest meaning first ...of top 20 ...of top 50 ... ...of top 100. Advanced. All; Adjectives; Nouns; Verbs; Adverbs; Idioms/Slang ... 8. unhandled....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found