@@ -1039,7 +1039,6 @@ namespace fbcpp
10391039 message[descriptor.offset ] = numericConverter.stringToBoolean (value);
10401040 break ;
10411041
1042- // FIXME: scale
10431042 case DescriptorAdjustedType::INT16 :
10441043 case DescriptorAdjustedType::INT32 :
10451044 case DescriptorAdjustedType::INT64 :
@@ -1066,8 +1065,6 @@ namespace fbcpp
10661065 }
10671066
10681067#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
1069- // FIXME: try/rethrow when parsing
1070- // FIXME: review
10711068 const auto parseDecimalToBoostInt128 = [this ](std::string_view text)
10721069 {
10731070 bool isNegative = false ;
@@ -1080,7 +1077,7 @@ namespace fbcpp
10801077 }
10811078
10821079 if (pos == text.size ())
1083- this ->numericConverter .throwNumericOutOfRange (); // FIXME: conversion error
1080+ this ->numericConverter .throwConversionErrorFromString (std::string{text});
10841081
10851082 BoostInt128 result{};
10861083
@@ -1089,7 +1086,7 @@ namespace fbcpp
10891086 const char c = text[pos];
10901087
10911088 if (c < ' 0' || c > ' 9' )
1092- this ->numericConverter .throwNumericOutOfRange (); // FIXME: conversion error
1089+ this ->numericConverter .throwConversionErrorFromString (std::string{text});
10931090
10941091 result *= 10 ;
10951092 result += static_cast <int >(c - ' 0' );
@@ -1113,7 +1110,7 @@ namespace fbcpp
11131110 const auto convResult =
11141111 std::from_chars (strValue.data (), strValue.data () + strValue.size (), intValue);
11151112 if (convResult.ec != std::errc{} || convResult.ptr != strValue.data () + strValue.size ())
1116- numericConverter.throwNumericOutOfRange (); // FIXME: conversion error
1113+ numericConverter.throwConversionErrorFromString (strValue);
11171114 auto scaledValue = ScaledInt64{intValue, scale};
11181115
11191116 if (scale != descriptor.scale )
@@ -1134,7 +1131,7 @@ namespace fbcpp
11341131 double doubleValue;
11351132 const auto convResult = std::from_chars (value.data (), value.data () + value.size (), doubleValue);
11361133 if (convResult.ec != std::errc{} || convResult.ptr != value.data () + value.size ())
1137- numericConverter.throwNumericOutOfRange (); // FIXME: conversion error
1134+ numericConverter.throwConversionErrorFromString (std::string{value});
11381135 setDouble (index, doubleValue);
11391136 return ;
11401137 }
@@ -1166,8 +1163,14 @@ namespace fbcpp
11661163#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
11671164 case DescriptorAdjustedType::DECFLOAT16 :
11681165 case DescriptorAdjustedType::DECFLOAT34 :
1169- // FIXME: try/rethrow when parsing
1170- setBoostDecFloat34 (index, BoostDecFloat34{value});
1166+ try
1167+ {
1168+ setBoostDecFloat34 (index, BoostDecFloat34{value});
1169+ }
1170+ catch (...)
1171+ {
1172+ numericConverter.throwConversionErrorFromString (std::string{value});
1173+ }
11711174 return ;
11721175#endif
11731176
@@ -2092,7 +2095,6 @@ namespace fbcpp
20922095 return outDescriptors[index];
20932096 }
20942097
2095- // FIXME: typeName unneeded or incorrect?
20962098 // /
20972099 // / @brief Converts and writes numeric parameter values following descriptor rules.
20982100 // /
@@ -2237,7 +2239,7 @@ namespace fbcpp
22372239 T convertNumber (
22382240 const Descriptor& descriptor, const std::byte* data, std::optional<int >& toScale, const char * toTypeName)
22392241 {
2240- if (!toScale.has_value ()) // FIXME: ?
2242+ if (!toScale.has_value ())
22412243 {
22422244 switch (descriptor.adjustedType )
22432245 {
0 commit comments