folly::ConversionCode

Error codes describing why a string-to-value conversion failed.

Synopsis

Declared in <folly/Conv.h>

enum class ConversionCode : unsigned char;

Description

Keep this in sync with kErrorStrings in Conv.cpp

Members

NameDescription
SUCCESS The conversion completed successfully.
EMPTY_INPUT_STRING The input string was empty.
NO_DIGITS The input contained no digits.
BOOL_OVERFLOW The value is out of range for a boolean.
BOOL_INVALID_VALUE The input is not a valid boolean spelling.
NON_DIGIT_CHAR An unexpected non-digit character was found.
INVALID_LEADING_CHAR The input began with an invalid character.
POSITIVE_OVERFLOW The value exceeds the maximum of the target type.
NEGATIVE_OVERFLOW The value is below the minimum of the target type.
STRING_TO_FLOAT_ERROR The input could not be parsed as a floating-point value.
NON_WHITESPACE_AFTER_END Non-whitespace characters followed the parsed value.
ARITH_POSITIVE_OVERFLOW An arithmetic conversion overflowed positively.
ARITH_NEGATIVE_OVERFLOW An arithmetic conversion overflowed negatively.
ARITH_LOSS_OF_PRECISION An arithmetic conversion would lose precision.
SPLIT_ERROR A delimited split failed.
CUSTOM A custom, user-supplied error code.
NUM_ERROR_CODES Sentinel count of error codes; has to be the last entry.

Non-Member Functions

NameDescription
makeConversionErrorCustom Error Translation