Print a correct error if an invalid stage is referenced.

(...by catching the right exception.)