launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #06875
Use Y.error() not Y.fail() in production code
Before YUI3, Y.fail() was used to throw an error in production code. It was later replaced by Y.error() and Y.fail() was moved to the YUI3 test module.
We had a number of places where Y.fail was used in code. Since the test infrastructure uses the 'test' module that misuse was not flagged. However if any failure path occurred in real life, the error we were trying to mark was masked by 'Y.fail function is undefined'.
I'm landing a branch now that fixes the places that did use Y.fail. Please refrain from using it outside of test code in the future.
Thanks!
--Brad