Catch solc exceptions in the worker the same way as in the non-worker version

pull/1/head
Alex Beregszaszi 8 years ago
parent 5aeb13657d
commit bd71078ea6
  1. 4
      src/app/compiler-worker.js

@ -16,10 +16,14 @@ module.exports = function (self) {
var compiler = solc(self.Module);
compileJSON = function (input, optimize) {
try {
return JSON.stringify(compiler.compile(JSON.parse(input), optimize, function (path) {
missingInputs.push(path);
return { 'error': 'Deferred import' };
}));
} catch (exception) {
return JSON.stringify({ error: 'Uncaught JavaScript exception:\n' + exception });
}
};
self.postMessage({

Loading…
Cancel
Save