Commit 7698da2e authored by Alex Beregszaszi's avatar Alex Beregszaszi Committed by GitHub

Merge pull request #189 from ethereum/worker-catch-exceptions

Catch solc exception in the worker the same way as the non-worker version
parents 5aeb1365 bd71078e
...@@ -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) {
try {
return JSON.stringify(compiler.compile(JSON.parse(input), optimize, function (path) { return JSON.stringify(compiler.compile(JSON.parse(input), optimize, function (path) {
missingInputs.push(path); missingInputs.push(path);
return { 'error': 'Deferred import' }; 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