fixing expected exception when view throws exception