Skip to content
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

Recover if protocol DOM agent throws error about domain not being enabled #861

Merged
merged 2 commits into from
Oct 31, 2016

Conversation

paulirish
Copy link
Member

@paulirish paulirish commented Oct 31, 2016

This fixes a regression we introduced in #830

DOM agent the only domain which complains if you attempt to disable when it was never enabled.

https://cs.chromium.org/search/?q=if.*!enabled+file:%5Esrc/third_party/WebKit/Source/core/inspector/+case:yes&sq=package:chromium&type=cs

This PR permits us to ignore these errors. And it should unbreak the master build.

@brendankenny
Copy link
Member

what about doing it in place in beginTrace itself? Something like

return this.sendCommand('Debugger.disable')
 .then(_ => {
   return this.sendCommand('DOM.disable')
     .catch(_ => {
       // We proactively disable the DOM domain. Ignore any error.
     });
 }).then(_ => this.sendCommand('CSS.disable'))

@paulirish
Copy link
Member Author

Good idea, done.

I've left the small refactor in connection.js for easier reading, but the catch() is much better.

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

nit, otherwise LGTM

log.formatProtocol('method <= browser ERR',
{method: callback.method}, 'error');
callback.reject(object.error);
return;
Copy link
Member

Choose a reason for hiding this comment

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

don't need the return here

Copy link
Member Author

Choose a reason for hiding this comment

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

sg. done

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.

2 participants