Skip to content

when debug flag set, print stack trace to console #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

silverbucket
Copy link
Contributor

I've got myself into a bit of a mess with the original restore for I was using to add features/fix things. So, to make things simpler, I've made a new fork and will manually import my changes one at a time of separate branches and submit them to you.

@@ -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
Contributor

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
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.

@silverbucket
Copy link
Contributor Author

ping @jcoglan

@jcoglan
Copy link
Owner

jcoglan commented Apr 6, 2015

@silverbucket Did you see my line note above?

I'm also not sure how the web console is relevant here. Is there a bridge between Node and the browser I'm not familiar with?

@raucao
Copy link
Contributor

raucao commented Apr 6, 2015

I'm also not sure how the web console is relevant here. Is there a bridge between Node and the browser I'm not familiar with?

Uhm, no idea how that brain fart happened! Was probably in the middle of commenting on remoteStorage(.js) issues left and right and somehow didn't realize what I was looking at. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants