theta-client-react-native 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +68 -48
- package/ios/ThetaClientReactNative.swift +101 -65
- package/lib/commonjs/NativeThetaClientReactNative.js +31 -2
- package/lib/commonjs/NativeThetaClientReactNative.js.map +1 -1
- package/lib/commonjs/theta-repository/libs/convert-utils.js +19 -0
- package/lib/commonjs/theta-repository/libs/convert-utils.js.map +1 -1
- package/lib/commonjs/theta-repository/libs/index.js +11 -0
- package/lib/commonjs/theta-repository/libs/index.js.map +1 -1
- package/lib/commonjs/theta-repository/libs/type-guards.js +13 -0
- package/lib/commonjs/theta-repository/libs/type-guards.js.map +1 -0
- package/lib/commonjs/theta-repository/theta-repository.js +7 -0
- package/lib/commonjs/theta-repository/theta-repository.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-web-api-error.js +62 -0
- package/lib/commonjs/theta-repository/theta-web-api-error.js.map +1 -0
- package/lib/module/NativeThetaClientReactNative.js +31 -2
- package/lib/module/NativeThetaClientReactNative.js.map +1 -1
- package/lib/module/theta-repository/libs/convert-utils.js +17 -0
- package/lib/module/theta-repository/libs/convert-utils.js.map +1 -1
- package/lib/module/theta-repository/libs/index.js +1 -0
- package/lib/module/theta-repository/libs/index.js.map +1 -1
- package/lib/module/theta-repository/libs/type-guards.js +7 -0
- package/lib/module/theta-repository/libs/type-guards.js.map +1 -0
- package/lib/module/theta-repository/theta-repository.js +1 -0
- package/lib/module/theta-repository/theta-repository.js.map +1 -1
- package/lib/module/theta-repository/theta-web-api-error.js +54 -0
- package/lib/module/theta-repository/theta-web-api-error.js.map +1 -0
- package/lib/typescript/NativeThetaClientReactNative.d.ts.map +1 -1
- package/lib/typescript/theta-repository/libs/convert-utils.d.ts +2 -0
- package/lib/typescript/theta-repository/libs/convert-utils.d.ts.map +1 -1
- package/lib/typescript/theta-repository/libs/index.d.ts +1 -0
- package/lib/typescript/theta-repository/libs/index.d.ts.map +1 -1
- package/lib/typescript/theta-repository/libs/type-guards.d.ts +5 -0
- package/lib/typescript/theta-repository/libs/type-guards.d.ts.map +1 -0
- package/lib/typescript/theta-repository/theta-repository.d.ts +1 -0
- package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-web-api-error.d.ts +15 -0
- package/lib/typescript/theta-repository/theta-web-api-error.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/NativeThetaClientReactNative.ts +50 -2
- package/src/theta-repository/libs/convert-utils.ts +19 -0
- package/src/theta-repository/libs/index.ts +1 -0
- package/src/theta-repository/libs/type-guards.ts +10 -0
- package/src/theta-repository/theta-repository.ts +1 -0
- package/src/theta-repository/theta-web-api-error.ts +81 -0
- package/theta-client-react-native.podspec +1 -1
package/android/build.gradle
CHANGED
|
@@ -68,7 +68,7 @@ dependencies {
|
|
|
68
68
|
implementation "com.facebook.react:react-native:+"
|
|
69
69
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
70
70
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3"
|
|
71
|
-
implementation "com.ricoh360.thetaclient:theta-client:1.
|
|
71
|
+
implementation "com.ricoh360.thetaclient:theta-client:1.15.0"
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
react {
|
|
@@ -164,7 +164,7 @@ class ThetaClientReactNativeModule(
|
|
|
164
164
|
)
|
|
165
165
|
promise.resolve(true)
|
|
166
166
|
} catch (t: Throwable) {
|
|
167
|
-
promise
|
|
167
|
+
rejectWithDetail(promise, t)
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
}
|
|
@@ -235,7 +235,7 @@ class ThetaClientReactNativeModule(
|
|
|
235
235
|
}
|
|
236
236
|
promise.resolve(result)
|
|
237
237
|
} catch (t: Throwable) {
|
|
238
|
-
promise
|
|
238
|
+
rejectWithDetail(promise, t)
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
}
|
|
@@ -257,7 +257,7 @@ class ThetaClientReactNativeModule(
|
|
|
257
257
|
val result = theta.getThetaLicense()
|
|
258
258
|
promise.resolve(result)
|
|
259
259
|
} catch (t: Throwable) {
|
|
260
|
-
promise
|
|
260
|
+
rejectWithDetail(promise, t)
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
}
|
|
@@ -280,7 +280,7 @@ class ThetaClientReactNativeModule(
|
|
|
280
280
|
val result = toResult(state)
|
|
281
281
|
promise.resolve(result)
|
|
282
282
|
} catch (t: Throwable) {
|
|
283
|
-
promise
|
|
283
|
+
rejectWithDetail(promise, t)
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
}
|
|
@@ -317,7 +317,7 @@ class ThetaClientReactNativeModule(
|
|
|
317
317
|
resultMap.putInt("totalEntries", totalEntries)
|
|
318
318
|
promise.resolve(resultMap)
|
|
319
319
|
} catch (t: Throwable) {
|
|
320
|
-
promise
|
|
320
|
+
rejectWithDetail(promise, t)
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
}
|
|
@@ -346,7 +346,7 @@ class ThetaClientReactNativeModule(
|
|
|
346
346
|
theta.deleteFiles(fileList)
|
|
347
347
|
promise.resolve(true)
|
|
348
348
|
} catch (t: Throwable) {
|
|
349
|
-
promise
|
|
349
|
+
rejectWithDetail(promise, t)
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
}
|
|
@@ -368,7 +368,7 @@ class ThetaClientReactNativeModule(
|
|
|
368
368
|
theta.deleteAllFiles()
|
|
369
369
|
promise.resolve(true)
|
|
370
370
|
} catch (t: Throwable) {
|
|
371
|
-
promise
|
|
371
|
+
rejectWithDetail(promise, t)
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
}
|
|
@@ -390,7 +390,7 @@ class ThetaClientReactNativeModule(
|
|
|
390
390
|
theta.deleteAllImageFiles()
|
|
391
391
|
promise.resolve(true)
|
|
392
392
|
} catch (t: Throwable) {
|
|
393
|
-
promise
|
|
393
|
+
rejectWithDetail(promise, t)
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
}
|
|
@@ -412,7 +412,7 @@ class ThetaClientReactNativeModule(
|
|
|
412
412
|
theta.deleteAllVideoFiles()
|
|
413
413
|
promise.resolve(true)
|
|
414
414
|
} catch (t: Throwable) {
|
|
415
|
-
promise
|
|
415
|
+
rejectWithDetail(promise, t)
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
}
|
|
@@ -436,7 +436,7 @@ class ThetaClientReactNativeModule(
|
|
|
436
436
|
val result = toResult(options = response)
|
|
437
437
|
promise.resolve(result)
|
|
438
438
|
} catch (t: Throwable) {
|
|
439
|
-
promise
|
|
439
|
+
rejectWithDetail(promise, t)
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
}
|
|
@@ -461,7 +461,7 @@ class ThetaClientReactNativeModule(
|
|
|
461
461
|
theta.setOptions(params)
|
|
462
462
|
promise.resolve(true)
|
|
463
463
|
} catch (t: Throwable) {
|
|
464
|
-
promise
|
|
464
|
+
rejectWithDetail(promise, t)
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
467
|
}
|
|
@@ -509,7 +509,7 @@ class ThetaClientReactNativeModule(
|
|
|
509
509
|
|
|
510
510
|
promise.resolve(true)
|
|
511
511
|
} catch (t: Throwable) {
|
|
512
|
-
promise
|
|
512
|
+
rejectWithDetail(promise, t)
|
|
513
513
|
} finally {
|
|
514
514
|
previewing = false
|
|
515
515
|
}
|
|
@@ -584,7 +584,7 @@ class ThetaClientReactNativeModule(
|
|
|
584
584
|
promise.resolve(true)
|
|
585
585
|
photoCaptureBuilder = null
|
|
586
586
|
} catch (t: Throwable) {
|
|
587
|
-
promise
|
|
587
|
+
rejectWithDetail(promise, t)
|
|
588
588
|
photoCaptureBuilder = null
|
|
589
589
|
}
|
|
590
590
|
}
|
|
@@ -669,7 +669,7 @@ class ThetaClientReactNativeModule(
|
|
|
669
669
|
promise.resolve(true)
|
|
670
670
|
timeShiftCaptureBuilder = null
|
|
671
671
|
} catch (t: Throwable) {
|
|
672
|
-
promise
|
|
672
|
+
rejectWithDetail(promise, t)
|
|
673
673
|
timeShiftCaptureBuilder = null
|
|
674
674
|
}
|
|
675
675
|
}
|
|
@@ -781,7 +781,7 @@ class ThetaClientReactNativeModule(
|
|
|
781
781
|
}
|
|
782
782
|
promise.resolve(true)
|
|
783
783
|
} catch (t: Throwable) {
|
|
784
|
-
promise
|
|
784
|
+
rejectWithDetail(promise, t)
|
|
785
785
|
} finally {
|
|
786
786
|
timeShiftManualCaptureBuilder = null
|
|
787
787
|
}
|
|
@@ -907,7 +907,7 @@ class ThetaClientReactNativeModule(
|
|
|
907
907
|
promise.resolve(true)
|
|
908
908
|
videoCaptureBuilder = null
|
|
909
909
|
} catch (t: Throwable) {
|
|
910
|
-
promise
|
|
910
|
+
rejectWithDetail(promise, t)
|
|
911
911
|
videoCaptureBuilder = null
|
|
912
912
|
}
|
|
913
913
|
}
|
|
@@ -1022,7 +1022,7 @@ class ThetaClientReactNativeModule(
|
|
|
1022
1022
|
promise.resolve(true)
|
|
1023
1023
|
limitlessIntervalCaptureBuilder = null
|
|
1024
1024
|
} catch (t: Throwable) {
|
|
1025
|
-
promise
|
|
1025
|
+
rejectWithDetail(promise, t)
|
|
1026
1026
|
limitlessIntervalCaptureBuilder = null
|
|
1027
1027
|
}
|
|
1028
1028
|
}
|
|
@@ -1141,7 +1141,7 @@ class ThetaClientReactNativeModule(
|
|
|
1141
1141
|
promise.resolve(true)
|
|
1142
1142
|
shotCountSpecifiedIntervalCaptureBuilder = null
|
|
1143
1143
|
} catch (t: Throwable) {
|
|
1144
|
-
promise
|
|
1144
|
+
rejectWithDetail(promise, t)
|
|
1145
1145
|
shotCountSpecifiedIntervalCaptureBuilder = null
|
|
1146
1146
|
}
|
|
1147
1147
|
}
|
|
@@ -1268,7 +1268,7 @@ class ThetaClientReactNativeModule(
|
|
|
1268
1268
|
promise.resolve(true)
|
|
1269
1269
|
compositeIntervalCaptureBuilder = null
|
|
1270
1270
|
} catch (t: Throwable) {
|
|
1271
|
-
promise
|
|
1271
|
+
rejectWithDetail(promise, t)
|
|
1272
1272
|
compositeIntervalCaptureBuilder = null
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
@@ -1413,7 +1413,7 @@ class ThetaClientReactNativeModule(
|
|
|
1413
1413
|
promise.resolve(true)
|
|
1414
1414
|
burstCaptureBuilder = null
|
|
1415
1415
|
} catch (t: Throwable) {
|
|
1416
|
-
promise
|
|
1416
|
+
rejectWithDetail(promise, t)
|
|
1417
1417
|
burstCaptureBuilder = null
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
@@ -1535,7 +1535,7 @@ class ThetaClientReactNativeModule(
|
|
|
1535
1535
|
promise.resolve(true)
|
|
1536
1536
|
multiBracketCaptureBuilder = null
|
|
1537
1537
|
} catch (t: Throwable) {
|
|
1538
|
-
promise
|
|
1538
|
+
rejectWithDetail(promise, t)
|
|
1539
1539
|
multiBracketCaptureBuilder = null
|
|
1540
1540
|
}
|
|
1541
1541
|
}
|
|
@@ -1659,7 +1659,7 @@ class ThetaClientReactNativeModule(
|
|
|
1659
1659
|
promise.resolve(true)
|
|
1660
1660
|
continuousCaptureBuilder = null
|
|
1661
1661
|
} catch (t: Throwable) {
|
|
1662
|
-
promise
|
|
1662
|
+
rejectWithDetail(promise, t)
|
|
1663
1663
|
continuousCaptureBuilder = null
|
|
1664
1664
|
}
|
|
1665
1665
|
}
|
|
@@ -1750,7 +1750,7 @@ class ThetaClientReactNativeModule(
|
|
|
1750
1750
|
metaInfo.putMap("xmp", xmp)
|
|
1751
1751
|
promise.resolve(metaInfo)
|
|
1752
1752
|
} catch (t: Throwable) {
|
|
1753
|
-
promise
|
|
1753
|
+
rejectWithDetail(promise, t)
|
|
1754
1754
|
}
|
|
1755
1755
|
}
|
|
1756
1756
|
}
|
|
@@ -1772,7 +1772,7 @@ class ThetaClientReactNativeModule(
|
|
|
1772
1772
|
theta.reboot()
|
|
1773
1773
|
promise.resolve(true)
|
|
1774
1774
|
} catch (t: Throwable) {
|
|
1775
|
-
promise
|
|
1775
|
+
rejectWithDetail(promise, t)
|
|
1776
1776
|
}
|
|
1777
1777
|
}
|
|
1778
1778
|
}
|
|
@@ -1794,7 +1794,7 @@ class ThetaClientReactNativeModule(
|
|
|
1794
1794
|
theta.reset()
|
|
1795
1795
|
promise.resolve(true)
|
|
1796
1796
|
} catch (t: Throwable) {
|
|
1797
|
-
promise
|
|
1797
|
+
rejectWithDetail(promise, t)
|
|
1798
1798
|
}
|
|
1799
1799
|
}
|
|
1800
1800
|
}
|
|
@@ -1816,7 +1816,7 @@ class ThetaClientReactNativeModule(
|
|
|
1816
1816
|
theta.restoreSettings()
|
|
1817
1817
|
promise.resolve(true)
|
|
1818
1818
|
} catch (t: Throwable) {
|
|
1819
|
-
promise
|
|
1819
|
+
rejectWithDetail(promise, t)
|
|
1820
1820
|
}
|
|
1821
1821
|
}
|
|
1822
1822
|
}
|
|
@@ -1838,7 +1838,7 @@ class ThetaClientReactNativeModule(
|
|
|
1838
1838
|
theta.stopSelfTimer()
|
|
1839
1839
|
promise.resolve(true)
|
|
1840
1840
|
} catch (t: Throwable) {
|
|
1841
|
-
promise
|
|
1841
|
+
rejectWithDetail(promise, t)
|
|
1842
1842
|
}
|
|
1843
1843
|
}
|
|
1844
1844
|
}
|
|
@@ -1876,7 +1876,7 @@ class ThetaClientReactNativeModule(
|
|
|
1876
1876
|
}
|
|
1877
1877
|
promise.resolve(convertedUrl)
|
|
1878
1878
|
} catch (t: Throwable) {
|
|
1879
|
-
promise
|
|
1879
|
+
rejectWithDetail(promise, t)
|
|
1880
1880
|
}
|
|
1881
1881
|
}
|
|
1882
1882
|
|
|
@@ -1899,7 +1899,7 @@ class ThetaClientReactNativeModule(
|
|
|
1899
1899
|
theta.cancelVideoConvert()
|
|
1900
1900
|
promise.resolve(true)
|
|
1901
1901
|
} catch (t: Throwable) {
|
|
1902
|
-
promise
|
|
1902
|
+
rejectWithDetail(promise, t)
|
|
1903
1903
|
}
|
|
1904
1904
|
}
|
|
1905
1905
|
}
|
|
@@ -1921,7 +1921,7 @@ class ThetaClientReactNativeModule(
|
|
|
1921
1921
|
theta.finishWlan()
|
|
1922
1922
|
promise.resolve(true)
|
|
1923
1923
|
} catch (t: Throwable) {
|
|
1924
|
-
promise
|
|
1924
|
+
rejectWithDetail(promise, t)
|
|
1925
1925
|
}
|
|
1926
1926
|
}
|
|
1927
1927
|
}
|
|
@@ -1943,7 +1943,7 @@ class ThetaClientReactNativeModule(
|
|
|
1943
1943
|
val response = theta.listAccessPoints()
|
|
1944
1944
|
promise.resolve(toListAccessPointsResult(accessPointList = response))
|
|
1945
1945
|
} catch (t: Throwable) {
|
|
1946
|
-
promise
|
|
1946
|
+
rejectWithDetail(promise, t)
|
|
1947
1947
|
}
|
|
1948
1948
|
}
|
|
1949
1949
|
}
|
|
@@ -1977,7 +1977,7 @@ class ThetaClientReactNativeModule(
|
|
|
1977
1977
|
)
|
|
1978
1978
|
promise.resolve(true)
|
|
1979
1979
|
} catch (t: Throwable) {
|
|
1980
|
-
promise
|
|
1980
|
+
rejectWithDetail(promise, t)
|
|
1981
1981
|
}
|
|
1982
1982
|
}
|
|
1983
1983
|
}
|
|
@@ -2017,7 +2017,7 @@ class ThetaClientReactNativeModule(
|
|
|
2017
2017
|
)
|
|
2018
2018
|
promise.resolve(true)
|
|
2019
2019
|
} catch (t: Throwable) {
|
|
2020
|
-
promise
|
|
2020
|
+
rejectWithDetail(promise, t)
|
|
2021
2021
|
}
|
|
2022
2022
|
}
|
|
2023
2023
|
}
|
|
@@ -2047,7 +2047,7 @@ class ThetaClientReactNativeModule(
|
|
|
2047
2047
|
theta.setAccessPointConnectionPriority(ssid, connectionPriority.toInt(), ssidStealth)
|
|
2048
2048
|
promise.resolve(true)
|
|
2049
2049
|
} catch (t: Throwable) {
|
|
2050
|
-
promise
|
|
2050
|
+
rejectWithDetail(promise, t)
|
|
2051
2051
|
}
|
|
2052
2052
|
}
|
|
2053
2053
|
}
|
|
@@ -2070,7 +2070,7 @@ class ThetaClientReactNativeModule(
|
|
|
2070
2070
|
theta.deleteAccessPoint(ssid)
|
|
2071
2071
|
promise.resolve(true)
|
|
2072
2072
|
} catch (t: Throwable) {
|
|
2073
|
-
promise
|
|
2073
|
+
rejectWithDetail(promise, t)
|
|
2074
2074
|
}
|
|
2075
2075
|
}
|
|
2076
2076
|
}
|
|
@@ -2093,7 +2093,7 @@ class ThetaClientReactNativeModule(
|
|
|
2093
2093
|
val deviceName = theta.setBluetoothDevice(uuid)
|
|
2094
2094
|
promise.resolve(deviceName)
|
|
2095
2095
|
} catch (t: Throwable) {
|
|
2096
|
-
promise
|
|
2096
|
+
rejectWithDetail(promise, t)
|
|
2097
2097
|
}
|
|
2098
2098
|
}
|
|
2099
2099
|
}
|
|
@@ -2117,7 +2117,7 @@ class ThetaClientReactNativeModule(
|
|
|
2117
2117
|
val options = theta.getMySetting(ThetaRepository.CaptureModeEnum.valueOf(captureMode))
|
|
2118
2118
|
promise.resolve(toResult(options = options))
|
|
2119
2119
|
} catch (t: Throwable) {
|
|
2120
|
-
promise
|
|
2120
|
+
rejectWithDetail(promise, t)
|
|
2121
2121
|
}
|
|
2122
2122
|
}
|
|
2123
2123
|
}
|
|
@@ -2147,7 +2147,7 @@ class ThetaClientReactNativeModule(
|
|
|
2147
2147
|
val options = theta.getMySetting(optionNameList)
|
|
2148
2148
|
promise.resolve(toResult(options = options))
|
|
2149
2149
|
} catch (t: Throwable) {
|
|
2150
|
-
promise
|
|
2150
|
+
rejectWithDetail(promise, t)
|
|
2151
2151
|
}
|
|
2152
2152
|
}
|
|
2153
2153
|
}
|
|
@@ -2172,7 +2172,7 @@ class ThetaClientReactNativeModule(
|
|
|
2172
2172
|
theta.setMySetting(ThetaRepository.CaptureModeEnum.valueOf(captureMode), thetaOptions)
|
|
2173
2173
|
promise.resolve(true)
|
|
2174
2174
|
} catch (t: Throwable) {
|
|
2175
|
-
promise
|
|
2175
|
+
rejectWithDetail(promise, t)
|
|
2176
2176
|
}
|
|
2177
2177
|
}
|
|
2178
2178
|
}
|
|
@@ -2195,7 +2195,7 @@ class ThetaClientReactNativeModule(
|
|
|
2195
2195
|
theta.deleteMySetting(ThetaRepository.CaptureModeEnum.valueOf(captureMode))
|
|
2196
2196
|
promise.resolve(true)
|
|
2197
2197
|
} catch (t: Throwable) {
|
|
2198
|
-
promise
|
|
2198
|
+
rejectWithDetail(promise, t)
|
|
2199
2199
|
}
|
|
2200
2200
|
}
|
|
2201
2201
|
}
|
|
@@ -2231,7 +2231,7 @@ class ThetaClientReactNativeModule(
|
|
|
2231
2231
|
}
|
|
2232
2232
|
promise.resolve(result)
|
|
2233
2233
|
} catch (t: Throwable) {
|
|
2234
|
-
promise
|
|
2234
|
+
rejectWithDetail(promise, t)
|
|
2235
2235
|
}
|
|
2236
2236
|
}
|
|
2237
2237
|
}
|
|
@@ -2254,7 +2254,7 @@ class ThetaClientReactNativeModule(
|
|
|
2254
2254
|
theta.setPlugin(packageName)
|
|
2255
2255
|
promise.resolve(true)
|
|
2256
2256
|
} catch (t: Throwable) {
|
|
2257
|
-
promise
|
|
2257
|
+
rejectWithDetail(promise, t)
|
|
2258
2258
|
}
|
|
2259
2259
|
}
|
|
2260
2260
|
}
|
|
@@ -2277,7 +2277,7 @@ class ThetaClientReactNativeModule(
|
|
|
2277
2277
|
theta.startPlugin(packageName)
|
|
2278
2278
|
promise.resolve(true)
|
|
2279
2279
|
} catch (t: Throwable) {
|
|
2280
|
-
promise
|
|
2280
|
+
rejectWithDetail(promise, t)
|
|
2281
2281
|
}
|
|
2282
2282
|
}
|
|
2283
2283
|
}
|
|
@@ -2299,7 +2299,7 @@ class ThetaClientReactNativeModule(
|
|
|
2299
2299
|
theta.stopPlugin()
|
|
2300
2300
|
promise.resolve(true)
|
|
2301
2301
|
} catch (t: Throwable) {
|
|
2302
|
-
promise
|
|
2302
|
+
rejectWithDetail(promise, t)
|
|
2303
2303
|
}
|
|
2304
2304
|
}
|
|
2305
2305
|
}
|
|
@@ -2322,7 +2322,7 @@ class ThetaClientReactNativeModule(
|
|
|
2322
2322
|
val result = theta.getPluginLicense(packageName)
|
|
2323
2323
|
promise.resolve(result)
|
|
2324
2324
|
} catch (t: Throwable) {
|
|
2325
|
-
promise
|
|
2325
|
+
rejectWithDetail(promise, t)
|
|
2326
2326
|
}
|
|
2327
2327
|
}
|
|
2328
2328
|
}
|
|
@@ -2344,7 +2344,7 @@ class ThetaClientReactNativeModule(
|
|
|
2344
2344
|
val result = theta.getPluginOrders()
|
|
2345
2345
|
promise.resolve(Arguments.fromList(result))
|
|
2346
2346
|
} catch (t: Throwable) {
|
|
2347
|
-
promise
|
|
2347
|
+
rejectWithDetail(promise, t)
|
|
2348
2348
|
}
|
|
2349
2349
|
}
|
|
2350
2350
|
}
|
|
@@ -2377,7 +2377,7 @@ class ThetaClientReactNativeModule(
|
|
|
2377
2377
|
theta.setPluginOrders(pluginList)
|
|
2378
2378
|
promise.resolve(true)
|
|
2379
2379
|
} catch (t: Throwable) {
|
|
2380
|
-
promise
|
|
2380
|
+
rejectWithDetail(promise, t)
|
|
2381
2381
|
}
|
|
2382
2382
|
}
|
|
2383
2383
|
}
|
|
@@ -2428,7 +2428,7 @@ class ThetaClientReactNativeModule(
|
|
|
2428
2428
|
})
|
|
2429
2429
|
promise.resolve(true)
|
|
2430
2430
|
} catch (t: Throwable) {
|
|
2431
|
-
promise
|
|
2431
|
+
rejectWithDetail(promise, t)
|
|
2432
2432
|
}
|
|
2433
2433
|
}
|
|
2434
2434
|
}
|
|
@@ -2452,10 +2452,30 @@ class ThetaClientReactNativeModule(
|
|
|
2452
2452
|
}
|
|
2453
2453
|
}
|
|
2454
2454
|
|
|
2455
|
+
private fun rejectWithDetail(promise: Promise, error: Throwable) {
|
|
2456
|
+
val webApiException = error as? ThetaRepository.ThetaWebApiException
|
|
2457
|
+
if (webApiException != null) {
|
|
2458
|
+
val statusCode = webApiException.statusCode
|
|
2459
|
+
val errorCode = webApiException.errorCode
|
|
2460
|
+
|
|
2461
|
+
val userInfo = Arguments.createMap()
|
|
2462
|
+
statusCode?.let { userInfo.putInt(ERROR_STATUS_CODE, it) }
|
|
2463
|
+
errorCode?.let { userInfo.putString(ERROR_CODE, it) }
|
|
2464
|
+
|
|
2465
|
+
android.util.Log.i("ThetaClientReactNative", "ThetaWebApiException statusCode=$statusCode errorCode=$errorCode message=${error.message}")
|
|
2466
|
+
promise.reject(ERROR_CODE_ERROR, error.message, userInfo)
|
|
2467
|
+
} else {
|
|
2468
|
+
promise.reject(error)
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2455
2472
|
companion object {
|
|
2456
2473
|
const val NAME = "ThetaClientReactNative"
|
|
2457
2474
|
const val EVENT_NAME = "ThetaFrameEvent"
|
|
2458
2475
|
const val EVENT_NOTIFY = "ThetaNotify"
|
|
2476
|
+
const val ERROR_CODE_ERROR = "error"
|
|
2477
|
+
const val ERROR_STATUS_CODE = "statusCode"
|
|
2478
|
+
const val ERROR_CODE = "errorCode"
|
|
2459
2479
|
const val NOTIFY_PHOTO_CAPTURING = "PHOTO-CAPTURING"
|
|
2460
2480
|
const val NOTIFY_TIMESHIFT_PROGRESS = "TIME-SHIFT-PROGRESS"
|
|
2461
2481
|
const val NOTIFY_TIMESHIFT_STOP_ERROR = "TIME-SHIFT-STOP-ERROR"
|