Skip to content

Commit

Permalink
add exception toml config
Browse files Browse the repository at this point in the history
Signed-off-by: howe <[email protected]>
  • Loading branch information
hzhyhx1117 committed Jan 12, 2022
1 parent 47e107d commit 603b4a1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions develop/flowunit/exception.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
}
```
+ 在自定义的需要捕获的flowunit当中,需要做如下两件事
+ 在自定义的需要捕获的flowunit当中,需要做如下三件事
1. 定义该flowunit的描述属性为ExceptionVisible(true)
> 定义该flowunit的描述属性为ExceptionVisible(true)
```c++
MODELBOX_FLOWUNIT(ExampleFlowUnit, desc) {
Expand All @@ -29,7 +29,7 @@
exception_visible = true # 若为python, 则在定义python的toml配置文件当中
```

1. 在获取flowunit的process当中获取exception error.
> 在获取flowunit的process当中获取exception error.
```c++
Status GetException::Process(std::shared_ptr<DataContext> data_ctx) {
Expand All @@ -50,6 +50,14 @@
# exception_desc 即为 "the desc you want to catch"
```

> 在定义的流程图当中增加属性exception可见
```toml
...
get_exception[..., is_exception_visible=true]
...
```

## 异常使用注意事项

+ 不要在if-else、loop当中以及拆分合并的flowunit中捕获异常

0 comments on commit 603b4a1

Please sign in to comment.