fix: Use same error message
This commit is contained in:
parent
fcefc7f9d9
commit
f91adb13be
@ -37,13 +37,12 @@ interface TVisionCameraProxy {
|
|||||||
initFrameProcessorPlugin: (name: string, options?: Record<string, ParameterType>) => FrameProcessorPlugin | undefined
|
initFrameProcessorPlugin: (name: string, options?: Record<string, ParameterType>) => FrameProcessorPlugin | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const errorMessage = 'Frame Processors are not available, react-native-worklets-core is not installed!'
|
||||||
|
|
||||||
let hasWorklets = false
|
let hasWorklets = false
|
||||||
let isAsyncContextBusy = { value: false }
|
let isAsyncContextBusy = { value: false }
|
||||||
let runOnAsyncContext = (_frame: Frame, _func: () => void): void => {
|
let runOnAsyncContext = (_frame: Frame, _func: () => void): void => {
|
||||||
throw new CameraRuntimeError(
|
throw new CameraRuntimeError('system/frame-processors-unavailable', errorMessage)
|
||||||
'system/frame-processors-unavailable',
|
|
||||||
'Frame Processors are not available, react-native-worklets-core is not installed!',
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -74,13 +73,13 @@ try {
|
|||||||
|
|
||||||
let proxy: TVisionCameraProxy = {
|
let proxy: TVisionCameraProxy = {
|
||||||
initFrameProcessorPlugin: () => {
|
initFrameProcessorPlugin: () => {
|
||||||
throw new CameraRuntimeError('system/frame-processors-unavailable', 'Frame Processors are not enabled!')
|
throw new CameraRuntimeError('system/frame-processors-unavailable', errorMessage)
|
||||||
},
|
},
|
||||||
removeFrameProcessor: () => {
|
removeFrameProcessor: () => {
|
||||||
throw new CameraRuntimeError('system/frame-processors-unavailable', 'Frame Processors are not enabled!')
|
throw new CameraRuntimeError('system/frame-processors-unavailable', errorMessage)
|
||||||
},
|
},
|
||||||
setFrameProcessor: () => {
|
setFrameProcessor: () => {
|
||||||
throw new CameraRuntimeError('system/frame-processors-unavailable', 'Frame Processors are not enabled!')
|
throw new CameraRuntimeError('system/frame-processors-unavailable', errorMessage)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if (hasWorklets) {
|
if (hasWorklets) {
|
||||||
|
Loading…
Reference in New Issue
Block a user