Skip to main content
Version: 0.10.0

Function: RnExecuTorchError()

RnExecuTorchError<C>(code, message, etRuntimeErrorCode?): RnExecuTorchError<C>

Defined in: core/error.ts:84

Creates an RnExecuTorchError carrying a machine-readable code.

Type Parameters

C

C extends "LOAD_FAILED" | "EXECUTION_FAILED" | "SCHEMA_MISMATCH" | "INVALID_ARGUMENT" | "INVALID_STATE" | "RESOURCE_DISPOSED" | "RESOURCE_BUSY" | "DOWNLOAD_FAILED" | "DOWNLOAD_ABORTED" | "UNKNOWN"

The specific error code.

Parameters

code

C

The classification to attach. See RnExecuTorchErrorCode.

message

string

A human-readable description of the failure.

etRuntimeErrorCode?

number

The raw ExecuTorch runtime error, when available.

Returns

RnExecuTorchError<C>

An Error carrying code and name: 'RnExecuTorchError'.

See

RnExecuTorchErrorCode

Example

throw RnExecuTorchError('INVALID_ARGUMENT', 'Shape dimensions must be positive');