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

Have a voice for developers: what should and should not be logged. #38

Open
johnjbarton opened this issue Apr 8, 2016 · 0 comments
Open

Comments

@johnjbarton
Copy link

This is a meta request inspired by a bug report to Chrome about SVG parsing errors.

https://bugs.chromium.org/p/chromium/issues/detail?id=601493#c3

A program like

<script>
(function () {
  try {
    var svgns = "http://www.w3.org/2000/svg";
    var shape = document.createElementNS(svgns, "circle");
    shape.setAttributeNS(null, "r",  "foo");
    console.log('No exception was thrown');
  } catch(ex) {
    console.error(ex.stack || ex);
  }
})();
</script>

Puts this in the console:

 'Error: <circle> attribute r: Expected length, "foo".'

Developers focus a lot of attention on the browser console. It is their
primary UI to develop web pages. As we are trying to use the Web to create
useful content, we request that the browser also try to be useful in its
output to the console for developers.

Sending "Error" to the console as a logging message is not useful. We
don't have any mechanism for routing such messages. We can't log them when
users find them; we can't check for them in unit tests; we can't prevent
them when we know the errors are harmless. There is an established and
effective solution for errors: throw JS exceptions or route the errors
through window.onerror.

Trying to report these issues to browsers is hopeless. I hope this group can have a stronger voice for developers. Thanks!

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

No branches or pull requests

1 participant