Catch JSON parsing errors of the Solidity output

Makes the error apparent for https://github.com/chriseth/browser-solidity/issues/114 and https://github.com/chriseth/browser-solidity/issues/132
pull/1/head
Alex Beregszaszi 9 years ago
parent 1f726cef36
commit 4172a86c17
  1. 9
      src/app.js

@ -624,9 +624,16 @@ var run = function() {
});
};
var compilationFinished = function(result, missingInputs) {
var data = $.parseJSON(result);
var data;
var noFatalErrors = true; // ie warnings are ok
try {
data = $.parseJSON(result);
} catch (exception) {
renderError('Invalid JSON output from the compiler: ' + exception);
return;
}
if (data['error'] !== undefined) {
renderError(data['error']);
if (errortype(data['error']) !== 'warning') noFatalErrors = false;

Loading…
Cancel
Save