Skip to content

Commit b3faf17

Browse files
Taritsyndustinsoftware
authored andcommitted
Save original exceptions as inner exceptions (#653)
1 parent 1576c93 commit b3faf17

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/React.Core/JavaScriptEngineFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ private void LoadUserScripts(IJsEngine engine)
195195
"Error while loading \"{0}\": {1}",
196196
file,
197197
ex.Message
198-
));
198+
), ex);
199199
}
200200
catch (IOException ex)
201201
{
202-
_scriptLoadException = new ReactScriptLoadException(ex.Message);
202+
_scriptLoadException = new ReactScriptLoadException(ex.Message, ex);
203203
}
204204
}
205205
}

src/React.Core/JavaScriptEngineUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static T CallFunctionReturningJson<T>(this IJsEngine engine, string funct
6060
throw new ReactException(string.Format(
6161
"{0} did not return valid JSON: {1}.\n\n{2}",
6262
function, ex.Message, resultJson
63-
));
63+
), ex);
6464
}
6565
}
6666
}

src/React.Core/ReactEnvironment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ protected virtual void EnsureUserScriptsLoaded()
215215
"Error while loading \"{0}\": {1}",
216216
file,
217217
ex.Message
218-
));
218+
), ex);
219219
}
220220
}
221221
Engine.SetVariableValue(USER_SCRIPTS_LOADED_KEY, true);

src/React.Core/ReactSiteConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public ReactSiteConfiguration()
5050
ComponentName,
5151
ex.Message,
5252
ContainerId
53-
));
53+
), ex);
5454
}
5555

5656
/// <summary>

0 commit comments

Comments
 (0)