RaiseException

Applicability

Product

Supported

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

x

Atlas training product

x

Function Description

Throws exceptions from the UDF, which are catchable by other UDFs in the same scope.

Prototype

1
void RaiseException(int32_t expCode, uint64_t userContextId)

Parameters

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.