From cf7806eff8cb5e7c419d212c67f61012707609f6 Mon Sep 17 00:00:00 2001 From: lukmccall Date: Thu, 27 Oct 2022 11:07:54 +0200 Subject: [PATCH] [modules][Android] Improve error messages in view events --- .../java/expo/modules/kotlin/viewevent/ViewEventDelegate.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/expo-modules-core/android/src/main/java/expo/modules/kotlin/viewevent/ViewEventDelegate.kt b/packages/expo-modules-core/android/src/main/java/expo/modules/kotlin/viewevent/ViewEventDelegate.kt index 4e598b670fa4d..076b942d9d876 100644 --- a/packages/expo-modules-core/android/src/main/java/expo/modules/kotlin/viewevent/ViewEventDelegate.kt +++ b/packages/expo-modules-core/android/src/main/java/expo/modules/kotlin/viewevent/ViewEventDelegate.kt @@ -20,11 +20,11 @@ class ViewEventDelegate( operator fun getValue(thisRef: View, property: KProperty<*>): ViewEventCallback { if (!isValidated) { - throw IllegalStateException("You have to export this property as a callback in the `ViewManager`.") + throw IllegalStateException("You have to export '${property.name}' property as a event in the `View` component") } val view = viewHolder.get() - ?: throw IllegalStateException("Can't send an event from the view that is deallocated.") + ?: throw IllegalStateException("Can't send the '${property.name}' event from the view that is deallocated") return ViewEvent(property.name, type, view, coalescingKey) } }