Currently, we often get exceptions from this method in our code,
although it's difficult to tell why. This would be very helpful
to make it clearer.
It is also more consistent with other exceptions raised in your
WEB-9116 #time 4h
This is the "Stack level too deep" problem we were having. It's
quite a rare case for it to happen. It happens only when the
numerator of a unit is a power (e.g. kg^2) and the denominator
starts with a 100<x> (e.g. 100l). Due to string-matching, it
incorrectly assumes that this unit is a rational number.
When doing this, it never allows the Unit's constructor to fully
complete because instead of being able to instantiate a
scalarless (i.e. scalar=1) unit, it continually creates scalar
values of e.g. 2/100, which equals 1/50. Hence it never settles.
This fixes it.