Show red boxes on HL mode

Summary:
public

We should further improve this on the future by showing the actual stacktrace instead of the `HMRClient` one. Also, we need to integrate this with the dev plugin that opens in the default editor the file/line the user clicks on.

Reviewed By: vjeux

Differential Revision: D2798889

fb-gh-sync-id: 2392966908c493e86e11b0d024e7b68156c9066c
This commit is contained in:
Martín Bigio
2016-01-07 13:14:18 -08:00
committed by facebook-github-bot-4
parent e46736219c
commit fe77ce1c62
2 changed files with 46 additions and 2 deletions

View File

@@ -48,8 +48,16 @@ URL: ${host}:${port}
Error: ${e.message}`
);
};
activeWS.onmessage = (m) => {
eval(m.data); // eslint-disable-line no-eval
activeWS.onmessage = ({data}) => {
data = JSON.parse(data);
if (data.type === 'update') {
eval(data.body); // eslint-disable-line no-eval
return;
}
// TODO: add support for opening filename by clicking on the stacktrace
const error = data.body;
throw new Error(error.type + ' ' + error.description);
};
},
};