From 7d7dddbffbe582fd77efce059df269bae6082286 Mon Sep 17 00:00:00 2001 From: Sergey Tarasov Date: Fri, 19 Aug 2016 12:41:52 +0300 Subject: [PATCH] modified message, updated js styling --- node_package/src/clientStartup.js | 3 ++- node_package/src/handleError.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/node_package/src/clientStartup.js b/node_package/src/clientStartup.js index 0c7ebba54..9a67ba8e9 100644 --- a/node_package/src/clientStartup.js +++ b/node_package/src/clientStartup.js @@ -78,7 +78,8 @@ You should return a React.Component always for the client side entry point.`); } } } catch (e) { - e.message = `Exception in rendering ${name}. ${e.message}`; + e.message = `ReactOnRails encountered an error while rendering component: ${name}.` + + `Original message: ${e.message}`; throw e; } } diff --git a/node_package/src/handleError.js b/node_package/src/handleError.js index 0c5f70b70..d0a465cce 100644 --- a/node_package/src/handleError.js +++ b/node_package/src/handleError.js @@ -35,7 +35,7 @@ component \'${name}\' is not a generator function.\n${lastLine}`; return msg; } -export default (options) => { +const handleError = (options) => { const { e, jsCode, serverSide } = options; console.error('Exception in rendering!'); @@ -64,3 +64,5 @@ ${e.stack}`; return ReactDOMServer.renderToString(reactElement); } }; + +export default handleError;