unitsofmeasurement / indriya

JSR 385 - Reference Implementation
Other
118 stars 40 forks source link

Improve error message for insufficient number/format of arguments #261

Open teobais opened 4 years ago

teobais commented 4 years ago

No Unit found is not descriptive at all.

We should at least make that error message more clear for cases like:

Our assumption for parsing a compound quantity is that there will be a space character between the value and the unit

keilw commented 4 years ago

I don't know if we'd get any more than Exception in thread "main" java.lang.NumberFormatException: For input string: "100.95" which the JDK Integer class gives when trying to parse a decimal string. The "75 kg" would require the correct value after it was parsed, we cannot assume or construct that in this particular situation, but showing all or the relevant section of that compound string looks doable.

somayaj commented 2 years ago

Hi, can this be assigned to me? Will be willing to contribute. Also, a code pointer. thx