Added JavaDoc for ~.error.*
Also extracted some errors and removed unused ones