diff --git a/core/native-bridge.js b/core/native-bridge.js index cb374f4c4..385c96afc 100644 --- a/core/native-bridge.js +++ b/core/native-bridge.js @@ -217,6 +217,14 @@ if (storedCall) { // looks like we've got a stored call + if (result.error && typeof result.error === 'object') { + // ensure stacktraces by copying error properties to an Error + result.error = Object.keys(result.error).reduce(function(err, key) { + err[key] = result.error[key]; + return err; + }, new Error()); + } + if (typeof storedCall.callback === 'function') { // callback if (result.success) {