raise error separate from return