File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
android/src/main/java/dev/matinzd/healthconnect Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -94,16 +94,24 @@ class HealthConnectManager(private val applicationContext: ReactApplicationConte
9494 fun revokeAllPermissions (promise : Promise ) {
9595 throwUnlessClientIsAvailable(promise) {
9696 coroutineScope.launch {
97- healthConnectClient.permissionController.revokeAllPermissions()
98- promise.resolve(true )
97+ try {
98+ healthConnectClient.permissionController.revokeAllPermissions()
99+ promise.resolve(true )
100+ } catch (e: Exception ) {
101+ promise.rejectWithException(e)
102+ }
99103 }
100104 }
101105 }
102106
103107 fun getGrantedPermissions (promise : Promise ) {
104108 throwUnlessClientIsAvailable(promise) {
105109 coroutineScope.launch {
106- promise.resolve(PermissionUtils .getGrantedPermissions(healthConnectClient.permissionController))
110+ try {
111+ promise.resolve(PermissionUtils .getGrantedPermissions(healthConnectClient.permissionController))
112+ } catch (e: Exception ) {
113+ promise.rejectWithException(e)
114+ }
107115 }
108116 }
109117 }
You can’t perform that action at this time.
0 commit comments