question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to disable printing javascript exceptions on console?

See original GitHub issue

I have tried all methods about disable printing exceptions, but console still printed a bunch of javascript exceptions information. Here is gradle setting: compile 'net.sourceforge.htmlunit:htmlunit:2.34.1' Here is my code: image image HtmlPage page = webClient.getPage(pageURL);

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
rbricommented, Mar 29, 2019

Ok, have done a lot of changes to fix this pain. In theory not it will be sufficient to do

webClient.setJavaScriptErrorListener(new SilentJavascriptErrorListener()); webClient.setCssErrorHandler(new SilentCSSErrorHandler());

As always this requires a build from the latest code. You can have a look at twitter; will inform there if a new snapshot is available.

0reactions
rbricommented, Mar 18, 2019

This is really a pain with the current version. Will cleanup the source and make a new snapshot available soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to quickly and conveniently disable all console.log ...
Redefine the console.log function in your script. console.log = function() {}. That's it, no more messages to console. EDIT: Expanding on Cide's idea....
Read more >
Stop Using console.log() In JavaScript | by Harsha Vardhan
This method is used to clear the console. It is often used if the console is clogged with messages/errors. The console will be...
Read more >
JavaScript console.error() Method - W3Schools
Definition and Usage. The error() method writes an error message to the console. The console is useful for testing purposes.
Read more >
Console | Node.js v19.3.0 Documentation
Creates a new Console with one or two writable stream instances. stdout is a writable stream to print log or info output. stderr...
Read more >
JavaScript Console.log() Example – How to Print to the ...
To reset the counter we can use console.countReset() . And, if you want to name the counter to something other than "default", you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found