I think what User:Rillke has done here -- offering the user a way to automatically report errors -- should be considered a best practice and documented more thoroughly here.
Topic on Manual talk:JS/API/UI Extension Developer Library
User:Rillke also pointed me to w:de:Wikipedia:Technik/Skin/JS which has lots of helpful pointers.
On Polish wikipedia there is also this:
And here is a request to have some sort of error reporting added to RL core.