make more error classes general to make Lattice template switch work