mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Don't ignore synchronous errors when calling Node
This commit is contained in:
@@ -45,10 +45,14 @@ function loadViaBabel(module, filename) {
|
||||
|
||||
module.exports = {
|
||||
renderToString: function(callback, options) {
|
||||
var component = findReactComponent(options);
|
||||
var history = createMemoryHistory(options.requestUrl);
|
||||
var reactElement = React.createElement(component, { history: history });
|
||||
var html = ReactDOMServer.renderToString(reactElement);
|
||||
callback(null, html);
|
||||
try {
|
||||
var component = findReactComponent(options);
|
||||
var history = createMemoryHistory(options.requestUrl);
|
||||
var reactElement = React.createElement(component, { history: history });
|
||||
var html = ReactDOMServer.renderToString(reactElement);
|
||||
callback(null, html);
|
||||
} catch (synchronousException) {
|
||||
callback(synchronousException);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user