Skip to content

Commit 3b36993

Browse files
committed
User 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 93d190e commit 3b36993

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
@@ -11,18 +11,21 @@ specific language governing permissions and limitations under the License.
1111
*/
1212

1313
/* eslint import/imports-first: "off" */
14+
/* eslint no-console: 0 */
15+
1416
// Must go before any require statements.
1517
const browserStartTime = Date.now();
1618

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

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

2426
process.on('unhandledRejection', (reason, p) => {
25-
console.log(`Unhandled Rejection at: Promise ${JSON.stringify(p)}, reason: ${reason.stack}`);
27+
console.error(`Unhandled Rejection at: Promise ${JSON.stringify(p)}`);
28+
console.error(reason.stack);
2629
process.exit(2);
2730
});
2831

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)