From 929d8d0877f925281aea50df453fcc8b3c938f95 Mon Sep 17 00:00:00 2001 From: Weibin Zeng Date: Thu, 7 Mar 2024 14:10:42 +0800 Subject: [PATCH] [Minor][C++] Revise the unsupported data type error msg to give more information (#391) * [Minor][C++] revise the unsupported data type error msg to give more information Signed-off-by: acezen --- cpp/src/data_type.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cpp/src/data_type.cc b/cpp/src/data_type.cc index 9d92a0bcf..69421ca92 100644 --- a/cpp/src/data_type.cc +++ b/cpp/src/data_type.cc @@ -42,7 +42,9 @@ std::shared_ptr DataType::DataTypeToArrowDataType( case Type::LIST: return arrow::list(DataTypeToArrowDataType(type->child_)); default: - throw std::runtime_error("Unsupported data type"); + std::string msg = "The data type " + type->ToTypeName() + + " is not supported yet in GraphAr"; + throw std::runtime_error(msg); } } @@ -66,7 +68,9 @@ std::shared_ptr DataType::ArrowDataTypeToDataType( case arrow::Type::LIST: return list(ArrowDataTypeToDataType(type->field(0)->type())); default: - throw std::runtime_error("Unsupported data type"); + std::string msg = "The arrow data type " + type->name() + + " is not supported yet in GraphAr"; + throw std::runtime_error(msg); } }