---
title: get_exception
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/others/dataflowdevg/udfrefp_23_0057.html
sourcePath: /source/zh/canncommercial/900/others/dataflowdevg/udfrefp_23_0057.html
indexId: 311a8687d7301874275d6cdbe529d178f345b3b571247125a6b2ddea28dcd65170
---
# get_exception

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | x |
| Atlas 推理系列产品 | x |
| Atlas 训练系列产品 | x |


#### 函数功能

UDF获取其他UDF节点上报的异常。


#### 函数原型

```
get_exception(self) -> tuple
```


#### 参数说明

无


#### 返回值

返回tuple(bool, int, int)，元组中各元素含义如下。

- 元组中第一个元素标识是否存在异常：True表示存在异常被捕获成功，False表示不存在异常。
- 元组中第二个元素标识被捕获异常中用户自定义的异常的错误码。
- 元组中第三个元素标识被捕获异常中用户自定义的异常的上下文ID，用于标识该上报的异常，保证其他UDF获取捕捉到异常后可以根据该ID值感知到具体产生异常的数据批次。


#### 异常处理

无


#### 约束说明

如果dataflow graph未通过set_exception_catch接口使能异常上报，调用该接口返回值第一个元素为false。
