fix: Log errors in update
and configureSession
This commit is contained in:
parent
f07f4a8770
commit
f1a5ee7ee1
@ -273,10 +273,12 @@ class CameraView(context: Context) : FrameLayout(context), LifecycleOwner {
|
|||||||
if (changedProps.contains("enableZoomGesture")) {
|
if (changedProps.contains("enableZoomGesture")) {
|
||||||
setOnTouchListener(if (enableZoomGesture) touchEventListener else null)
|
setOnTouchListener(if (enableZoomGesture) touchEventListener else null)
|
||||||
}
|
}
|
||||||
} catch (e: CameraError) {
|
|
||||||
invokeOnError(e)
|
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
invokeOnError(UnknownCameraError(e))
|
Log.e(TAG, "update() threw: ${e.message}")
|
||||||
|
when(e) {
|
||||||
|
is CameraError -> invokeOnError(e)
|
||||||
|
else -> invokeOnError(UnknownCameraError(e))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -432,6 +434,7 @@ class CameraView(context: Context) : FrameLayout(context), LifecycleOwner {
|
|||||||
Log.i(TAG_PERF, "Session configured in $duration ms! Camera: ${camera!!}")
|
Log.i(TAG_PERF, "Session configured in $duration ms! Camera: ${camera!!}")
|
||||||
invokeOnInitialized()
|
invokeOnInitialized()
|
||||||
} catch (exc: Throwable) {
|
} catch (exc: Throwable) {
|
||||||
|
Log.e(TAG, "Failed to configure session: ${exc.message}")
|
||||||
throw when (exc) {
|
throw when (exc) {
|
||||||
is CameraError -> exc
|
is CameraError -> exc
|
||||||
is IllegalArgumentException -> {
|
is IllegalArgumentException -> {
|
||||||
|
Loading…
Reference in New Issue
Block a user