From 4499f203a3ee9d6567b2af9011ee9e4378de0eab Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 1 Jul 2020 00:34:51 +0200 Subject: Core/DataStores: Fixed sending localized hotfixes and improved db2 loading error messages --- src/common/DataStores/DB2FileLoader.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/common/DataStores/DB2FileLoader.h') diff --git a/src/common/DataStores/DB2FileLoader.h b/src/common/DataStores/DB2FileLoader.h index 6f0bca5ee5b..72a5f66768d 100644 --- a/src/common/DataStores/DB2FileLoader.h +++ b/src/common/DataStores/DB2FileLoader.h @@ -19,6 +19,7 @@ #define DB2_FILE_LOADER_H #include "Common.h" +#include #include #include @@ -163,6 +164,17 @@ struct DB2RecordCopy }; #pragma pack(pop) +class TC_COMMON_API DB2FileLoadException : public std::exception +{ +public: + DB2FileLoadException(std::string msg) : _msg(std::move(msg)) { } + + char const* what() const noexcept override { return _msg.c_str(); } + +private: + std::string _msg; +}; + class TC_COMMON_API DB2FileLoader { public: @@ -170,8 +182,8 @@ public: ~DB2FileLoader(); // loadInfo argument is required when trying to read data from the file - bool LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* loadInfo); - bool Load(DB2FileSource* source, DB2FileLoadInfo const* loadInfo); + void LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* loadInfo); + void Load(DB2FileSource* source, DB2FileLoadInfo const* loadInfo); char* AutoProduceData(uint32& indexTableSize, char**& indexTable); char* AutoProduceStrings(char** indexTable, uint32 indexTableSize, LocaleConstant locale); void AutoProduceRecordCopies(uint32 records, char** indexTable, char* dataTable); -- cgit v1.2.3