Add error handling (via exception) to AbstractRuleSet loading 75/275575/1 accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix tizen_7.0 tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.062440 accepted/tizen/7.0/unified/hotfix/20221116.105514 accepted/tizen/unified/20220704.213040 submit/tizen/20220704.031713 tizen_7.0_m2_release
authorTomasz Swierczek <t.swierczek@samsung.com>
Thu, 26 May 2022 09:55:40 +0000 (11:55 +0200)
committerTomasz Swierczek <t.swierczek@samsung.com>
Thu, 26 May 2022 09:55:40 +0000 (11:55 +0200)
Change-Id: I61bc09a68fcfbc78ee73bb1b503c4cd73ceb6b91

server/loader.cpp

index 8e714145ced2e8537baa34973535b5d4bd15fcd7..b0a60f4e852c8c23338548c14588f82f6738d433 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2018 - 2022 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -40,6 +40,8 @@ AbstractRuleSet::RuleList RuleSetLoader::load(const std::string &path)
        if (factory) {
                ruleSet.reset(reinterpret_cast<AbstractRuleSet*>(factory()));
                ruleSet->initialize();
+       } else {
+               throw runtime::Exception("Failed to dlsym RuleSetFactory");
        }
 
        return ruleSet->get();