Skip to content
Open
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
3 changes: 3 additions & 0 deletions lib/restore.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ var Restore = function(options) {
d.add(response);

d.on('error', function(error) {
if (self._allow.debug) {
console.log('error: ', error, error.stack);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it's reasonable to assume whoever uses the debug flag also uses a modern browser, you can actually throw an error here using error(message). See https://developer.mozilla.org/en-US/docs/Tools/Web_Console?redirectlocale=en-US&redirectslug=Using_the_Web_Console#Error_messages

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change this to use process.env.DEBUG as the flag, please? We already support that option and I don't think we should add a new config option.

}
new Assets(self, request, response).errorPage(500, error.message);
});

Expand Down