Fix error where we were raising an exception of the wrong class.