bool IDLParserErrorContext::checkAndAssertBinDataTypeSlowPath(const BSONElement& element,
                                                              BinDataType type) const {
    bool isBinDataType = checkAndAssertType(element, BinData);
    if (!isBinDataType) {
        return false;
    }

    if (element.binDataType() != type) {
        std::string path = getElementPath(element);
        uasserted(ErrorCodes::TypeMismatch,
                  str::stream() << "BSON field '" << path << "' is the wrong bindData type '"
                                << typeName(element.binDataType())
                                << "', expected type '"
                                << typeName(type)
                                << "'");
    }

    return true;
}
bool IDLParserErrorContext::checkAndAssertBinDataTypeSlowPath(const BSONElement& element,
                                                              BinDataType type) const {
    bool isBinDataType = checkAndAssertType(element, BinData);
    if (!isBinDataType) {
        return false;
    }

    if (element.binDataType() != type) {
        std::string path = getElementPath(element);
        uasserted(ErrorCodes::TypeMismatch,
                  str::stream() << "BSON field '" << path << "' is the wrong bindData type '"
                                << typeName(element.binDataType())
                                << "', expected type '"
                                << typeName(type)
                                << "'");
    }

    return true;
}