There are thousands of places in Moodle where we are using the error() function to print out hardcoded strings.
In the long term, we should end with ZERO calls to this function, by using the print_error() on instead.
Here it's one plan that could be good to start handling this migration:
1) Move error() to deprecatelib. Just that. 1.9 and HEAD
2) Make print_error() autonomous so it won't rely on error() code anymore (will cause code duplication, I guess, but better in the long term.) 1.9 and HEAD
3) Under HEAD (not under 19_STABLE because it could be the plague!), in the deprecated error() function, add some DEBUG_DEVELOPER debugging() to inform developers. It will cause a lot of output (pain!)
4) Move all current uses of error(get_string('xxxx')) to a proper use of print_error() 1.9 and HEAD
5) Gradually, start creating error strings and changing error() calls to print_error() ones. Moodle 2.0 should be free of error() calls. HEAD only.
This is the overall plan. I think each step above could be a subtask of this. Please review it with MD. I think it could work (although once we do point 3 HEAD will be horrible until we'll have all the error() uses killed).