This method could be made more readable: the contents of this `else` could be moved up to where `errorMessage` is set, and the null `errorMessage` check removed completely. More simplification should be possible after that as well.