简体   繁体   中英

How to get polymer.js software to report on errors/exceptions?

Is it possible to track errors in polymer.js in a strategic way? Somehow I don't get any error-messages or Exceptions. In case of Errors, Polymer just does nothing if I'm doing something wrong.

For example, if I add the property disableSwipe to paper-drawer-panel , it is ignored, but there is no error-message or logging that could give me a hint what is going wrong. (I still don't know why, but this is offtopic)

Is there any way to activate some Kind of strict-mode that would cause Polymer to throw Exceptions in case of an error, or at least activate some logging that would show error-messages?

Debugging without errorMessages feels too much coincidence-based to me.

Someone else beat you to this complaint and filed an issue with Polymer.js.

https://github.com/Polymer/polymer/issues/3367

I searched through the Polymer project and there is no mention of error handling or exception handling or increased verbosity levels, and until they code something in to implement those features, you'll be left with the default javascript runtime, coding blind and with poor mans debugger.

As an alternative, the polymer.js people recommend using polylint, which won't give you information about runtime errors or exceptions, but instead a static code analysis analyzer, and it might not find your exception because your error might be some off-by-one error that static code analysis can't find.

https://github.com/PolymerLabs/polylint

That's a bad code smell and strike against Polymer.js If you can't bother to put in proper exception reporting and error handling, I can't be bothered to use your product.

The best you're going to get other than polylint is whatever the google javascript developer tools embedded in google chrome browser gives you:

https://developers.google.com/web/tools/chrome-devtools/inspect-styles/shortcuts

That will give you warnings and errors, but that's only if the polymer.js devs wrote an actual bug. If it doesn't halt on an error or warning, you're left to inspect and watch the javascript code line by line, and try to guess what went wrong by reading the Polymer.js source.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM