Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@ function fastbootExpressMiddleware(distPath, options) {
if (error.name === "UnrecognizedURLError") {
next();
} else {
log(500, "Unknown Error: " + error.stack);
if (error.stack) {
res.status(500).send(error.stack);
if (typeof opts.onFailure === 'function') {
opts.onFailure(error, req, res, next);
} else {
res.sendStatus(500);
log(500, "Unknown Error: " + error.stack);
if (error.stack) {
res.status(500).send(error.stack);
} else {
res.sendStatus(500);
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "An Express middleware for rendering Ember apps with FastBoot",
"main": "index.js",
"scripts": {
"test": "mocha"
"test": "./node_modules/mocha/bin/mocha",
"test:watch": "./node_modules/mocha/bin/mocha -w"
},
"repository": {
"type": "git",
Expand Down
359 changes: 359 additions & 0 deletions test/fixtures/error-case/assets/fastboot-test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading