RaiseException

Applicable Products

Product

Supported

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

Function Description

A UDF proactively reports an exception, which can be captured by other UDFs in the same scope.

Prototype

1
void RaiseException(int32_t expCode, uint64_t userContextId)

Command-Line Options

Parameter

Input/Output

Description

expCode

Input

User-defined error code.

userContextId

Input

Context ID of a user-defined exception, which is used to identify the reported exception. This ensures that other UDFs can identify the specific data batch that caused the exception based on this ID after capturing the exception.

Returns

None

Exception Handling

Print error logs.

Constraints

If exception reporting is not enabled for the current DataFlow graph through SetExceptionCatch, calling this API in the UDF will cause the process to abort with an error.

In scenarios with streaming input (that is, the FlowFunc input is a queue), the UDF cannot proactively report exceptions.