While looking at bug 39575 I noticed the wrong exception was thrown. This fixes the exception thrown and adds a unit test.
LGTM - thanks!
Do you need me to commit this?
Thanks for the review.
Yes, please commit it for me since I don't have commit access.
Landed as revision 361887.