Commit bd71078e authored by Alex Beregszaszi's avatar Alex Beregszaszi

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

parent 5aeb1365
...@@ -16,10 +16,14 @@ module.exports = function (self) { ...@@ -16,10 +16,14 @@ module.exports = function (self) {
var compiler = solc(self.Module); var compiler = solc(self.Module);
compileJSON = function (input, optimize) { compileJSON = function (input, optimize) {
return JSON.stringify(compiler.compile(JSON.parse(input), optimize, function (path) { try {
missingInputs.push(path); return JSON.stringify(compiler.compile(JSON.parse(input), optimize, function (path) {
return { 'error': 'Deferred import' }; missingInputs.push(path);
})); return { 'error': 'Deferred import' };
}));
} catch (exception) {
return JSON.stringify({ error: 'Uncaught JavaScript exception:\n' + exception });
}
}; };
self.postMessage({ self.postMessage({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment