Skip to content

Commit b8d87eb

Browse files
committed
Use a custom source-map-support in order to get meaningful stack traces.
The source-map-support package doesn't appreciate absolute file:// URLs. I tried to address this in evanw/node-source-map-support#133 and made some progress before discovering evanw/node-source-map-support#126. I pushed that work, and a small follow-up, to my local version used here. With this, I get stack traces that referring to app/.
1 parent 168cb60 commit b8d87eb

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

app/main/browser.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,21 @@ specific language governing permissions and limitations under the License.
1313
*/
1414

1515
/* eslint import/imports-first: "off" */
16+
/* eslint no-console: 0 */
17+
1618
// Must go before any require statements.
1719
const browserStartTime = Date.now();
1820

19-
/* eslint no-console: 0 */
21+
import 'source-map-support/register';
2022

2123
process.on('uncaughtException', (err) => {
22-
console.log(err.stack);
24+
console.error(err.stack);
2325
process.exit(1);
2426
});
2527

2628
process.on('unhandledRejection', (reason, p) => {
27-
console.log(`Unhandled Rejection at: Promise ${JSON.stringify(p)}, reason: ${reason.stack}`);
29+
console.error(`Unhandled Rejection at: Promise ${JSON.stringify(p)}`);
30+
console.error(reason.stack);
2831
process.exit(2);
2932
});
3033

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"react-addons-perf": "15.0.1",
6666
"react-addons-test-utils": "15.0.1",
6767
"rimraf": "2.5.2",
68+
"source-map-support": "ncalexan/node-source-map-support#fileUrls-plus",
6869
"spectron": "1.37.0",
6970
"through2": "2.0.1",
7071
"tmp": "0.0.28",

0 commit comments

Comments
 (0)