提交 0c746acc 编写于 作者: Z zhengweiwei2

Fix the problem that hb tool exceptions cannot be caught

Signed-off-by: Nzhengweiwei2 <zhengweiwei7@huawei.com>
上级 1845c7f8
...@@ -61,7 +61,7 @@ class Tool(): ...@@ -61,7 +61,7 @@ class Tool():
else: else:
self.out_path = read_json_file(os.path.join(find_top(), 'ohos_config.json'))['out_path'] self.out_path = read_json_file(os.path.join(find_top(), 'ohos_config.json'))['out_path']
if not os.path.isdir(self.out_path): if not os.path.isdir(self.out_path):
raise FileNotFoundError(f"{self.out_path} doesn't exist.") raise OHOSException(f"{self.out_path} doesn't exist.")
def register_target(self, component, module): def register_target(self, component, module):
target_name = self.get_target_name(component, module) target_name = self.get_target_name(component, module)
...@@ -97,7 +97,7 @@ class Tool(): ...@@ -97,7 +97,7 @@ class Tool():
def read_gn_file(self, input_file): def read_gn_file(self, input_file):
if not os.path.exists(input_file): if not os.path.exists(input_file):
raise FileNotFoundError("file '{}' doesn't exist.".format(input_file)) raise OHOSException("file '{}' doesn't exist.".format(input_file))
data = None data = None
with open(input_file, 'r') as input_f: with open(input_file, 'r') as input_f:
data = input_f.read() data = input_f.read()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册