Skip to content

ReactNative SDK Reference / tryParseNativeCameraError

Function: tryParseNativeCameraError()

tryParseNativeCameraError<T>(nativeError): CameraRuntimeError | CameraCaptureError | T

Tries to parse an error coming from native to a typed JS camera error.

Type parameters

T

Parameters

nativeError: T

The native error instance. This is a JSON in the legacy native module architecture.

Returns

CameraRuntimeError | CameraCaptureError | T

A CameraRuntimeError or CameraCaptureError, or the nativeError itself if it's not parsable

Method