10000 Fix error codes vs messages · flutter-webrtc/flutter-webrtc@60aef21 · GitHub
[go: up one dir, main page]

Skip to content

Commit 60aef21

Browse files
committed
Fix error codes vs messages
1 parent f397f84 commit 60aef21

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

android/src/main/java/com/cloudwebrtc/webrtc/FlutterWebRTCPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,9 @@ public void onMethodCall(MethodCall call, Result notSafeResult) {
375375
if (track instanceof VideoTrack)
376376
new FrameCapturer((VideoTrack) track, new File(path), result);
377377
else
378-
result.error("It's not video track", null, null);
378+
result.error(null, "It's not video track", null);
379379
} else {
380-
result.error("Track is null", null, null);
380+
result.error(null, "Track is null", null);
381381
}
382382
} else if (call.method.equals("getLocalDescription")) {
383383
String peerConnectionId = call.argument("peerConnectionId");

android/src/main/java/com/cloudwebrtc/webrtc/GetUserMediaImpl.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ public void invoke(String[] permissions_, int[] grantResults) {
754754
void switchCamera(String id, Result result) {
755755
VideoCapturer videoCapturer = mVideoCapturers.get(id);
756756
if (videoCapturer == null) {
757-
result.error("Video capturer not found for id: " + id, null, null);
757+
result.error(null, "Video capturer not found for id: " + id, null);
758758
return;
759759
}
760760

@@ -811,7 +811,7 @@ void stopRecording(Integer id) {
811811
void hasTorch(String trackId, Result result) {
812812
VideoCapturer videoCapturer = mVideoCapturers.get(trackId);
813813
if (videoCapturer == null) {
814-
result.error("Video capturer not found for id: " + trackId, null, null);
814+
result.error(null, "Video capturer not found for id: " + trackId, null);
815815
return;
816816
}
817817

@@ -824,7 +824,7 @@ void hasTorch(String trackId, Result result) {
824824
} catch (NoSuchFieldException e) {
825825
// Most likely the upstream Camera1Capturer class have changed
826826
Log.e(TAG, "[TORCH] Failed to get `currentSession` from `Camera1Capturer`");
827-
result.error("Failed to get `currentSession` from `Camera1Capturer`", null, null);
827+
result.error(null, "Failed to get `currentSession` from `Camera1Capturer`", null);
828828
return;
829829
} catch (IllegalAccessException e) {
830830
// Should never happen since we are calling `setAccessible(true)`
@@ -839,7 +839,7 @@ void hasTorch(String trackId, Result result) {
839839
} catch (NoSuchFieldException e) {
840840
// Most likely the upstream Camera2Capturer class have changed
841841
Log.e(TAG, "[TORCH] Failed to get `cameraManager` from `Camera2Capturer`");
842-
result.error("Failed to get `cameraManager` from `Camera2Capturer`", null, null);
842+
result.error(null, "Failed to get `cameraManager` from `Camera2Capturer`", null);
843843
return;
844844
} catch (IllegalAccessException e) {
845845
// Should never happen since we are calling `setAccessible(true)`
@@ -854,7 +854,7 @@ void hasTorch(String trackId, Result result) {
854854
} catch (NoSuchFieldException e) {
855855
// Most likely the upstream Camera2Capturer class have changed
856856
Log.e(TAG, "[TORCH] Failed to get `cameraDevice` from `Camera2Capturer`");
857-
result.error("Failed to get `cameraDevice` from `Camera2Capturer`", null, null);
857+
result.error(null, "Failed to get `cameraDevice` from `Camera2Capturer`", null);
858858
return;
859859
} catch (IllegalAccessException e) {
860860
// Should never happen since we are calling `setAccessible(true)`
@@ -883,7 +883,7 @@ void hasTorch(String trackId, Result result) {
883883
} catch (NoSuchFieldException e) {
884884
// Most likely the upstream Camera1Capturer class have changed
885885
Log.e(TAG, "[TORCH] Failed to get `currentSession` from `Camera1Capturer`");
886-
result.error("Failed to get `currentSession` from `Camera1Capturer`", null, null);
886+
result.error(null, "Failed to get `currentSession` from `Camera1Capturer`", null);
887887
return;
888888
} catch (IllegalAccessException e) {
889889
// Should never happen since we are calling `setAccessible(true)`
@@ -898,7 +898,7 @@ void hasTorch(String trackId, Result result) {
898898
} catch (NoSuchFieldException e) {
899899
// Most likely the upstream Camera1Session class have changed
900900
Log.e(TAG, "[TORCH] Failed to get `camera` from `Camera1Session`");
901-
result.error("Failed to get `camera` from `Camera1Session`", null, null);
901+
result.error(null, "Failed to get `camera` from `Camera1Session`", null);
902902
return;
903903
} catch (IllegalAccessException e) {
904904
// Should never happen since we are calling `setAccessible(true)`
@@ -918,13 +918,13 @@ void hasTorch(String trackId, Result result) {
918918
}
919919

920920
Log.e(TAG, "[TORCH] Video capturer not compatible");
921-
result.error("Video capturer not compatible", null, null);
921+
result.error(null, "Video capturer not compatible", null);
922922
}
923923

924924
void setTorch(String trackId, boolean torch, Result result) {
925925
VideoCapturer videoCapturer = mVideoCapturers.get(trackId);
926926
if (videoCapturer == null) {
927-
result.error("Video capturer not found for id: " + trackId, null, null);
927+
result.error(null, "Video capturer not found for id: " + trackId, null);
928928
return;
929929
}
930930

@@ -937,7 +937,7 @@ void setTorch(String trackId, boolean torch, Result result) {
937937
} catch (NoSuchFieldException e) {
938938
// Most likely the upstream Camera1Capturer class have changed
939939
Log.e(TAG, "[TORCH] Failed to get `currentSession` from `Camera1Capturer`");
940-
result.error("Failed to get `currentSession` from `Camera1Capturer`", null, null);
940+
result.error(null, "Failed to get `currentSession` from `Camera1Capturer`", null);
941941
return;
942942
} catch (IllegalAccessException e) {
943943
// Should never happen since we are calling `setAccessible(true)`
@@ -952,7 +952,7 @@ void setTorch(String trackId, boolean torch, Result result) {
952952
} catch (NoSuchFieldException e) {
953953
// Most likely the upstream Camera2Capturer class have changed
954954
Log.e(TAG, "[TORCH] Failed to get `cameraManager` from `Camera2Capturer`");
955-
result.error("Failed to get `cameraManager` from `Camera2Capturer`", null, null);
955+
result.error(null, "Failed to get `cameraManager` from `Camera2Capturer`", null);
956956
return;
957957
} catch (IllegalAccessException e) {
958958
// Should never happen since we are calling `setAccessible(true)`
@@ -967,7 +967,7 @@ void setTorch(String trackId, boolean torch, Result result) {
967967
} catch (NoSuchFieldException e) {
968968
// Most likely the upstream Camera2Capturer class have changed
969969
Log.e(TAG, "[TORCH] Failed to get `captureSession` from `Camera2Capturer`");
970-
result.error("Failed to get `captureSession` from `Camera2Capturer`", null, null);
970+
result.error(null, "Failed to get `captureSession` from `Camera2Capturer`", null);
971971
return;
972972
} catch (IllegalAccessException e) {
973973
// Should never happen since we are calling `setAccessible(true)`
@@ -982,7 +982,7 @@ void setTorch(String trackId, boolean torch, Result result) {
982982
} catch (NoSuchFieldException e) {
983983
// Most likely the upstream Camera2Capturer class have changed
984984
Log.e(TAG, "[TORCH] Failed to get `cameraDevice` from `Camera2Capturer`");
985-
result.error("Failed to get `cameraDevice` from `Camera2Capturer`", null, null);
985+
result.error(null, "Failed to get `cameraDevice` from `Camera2Capturer`", null);
986986
return;
987987
} catch (IllegalAccessException e) {
988988
// Should never happen since we are calling `setAccessible(true)`
@@ -997,7 +997,7 @@ void setTorch(String trackId, boolean torch, Result result) {
997997
} catch (NoSuchFieldException e) {
998998
// Most likely the upstream Camera2Capturer class have changed
999999
Log.e(TAG, "[TORCH] Failed to get `captureFormat` from `Camera2Capturer`");
1000-
result.error("Failed to get `captureFormat` from `Camera2Capturer`", null, null);
1000+
result.error(null, "Failed to get `captureFormat` from `Camera2Capturer`", null);
10011001
return;
10021002
} catch (IllegalAccessException e) {
10031003
// Should never happen since we are calling `setAccessible(true)`
@@ -1012,7 +1012,7 @@ void setTorch(String trackId, boolean torch, Result result) {
10121012
} catch (NoSuchFieldException e) {
10131013
// Most likely the upstream Camera2Capturer class have changed
10141014
Log.e(TAG, "[TORCH] Failed to get `fpsUnitFactor` from `Camera2Capturer`");
1015-
result.error("Failed to get `fpsUnitFactor` from `Camera2Capturer`", null, null);
1015+
result.error(null, "Failed to get `fpsUnitFactor` from `Camera2Capturer`", null);
10161016
return;
10171017
} catch (IllegalAccessException e) {
10181018
// Should never happen since we are calling `setAccessible(true)`
@@ -1027,7 +1027,7 @@ void setTorch(String trackId, boolean torch, Result result) {
10271027
} catch (NoSuchFieldException e) {
10281028
// Most likely the upstream Camera2Capturer class have changed
10291029
Log.e(TAG, "[TORCH] Failed to get `surface` from `Camera2Capturer`");
1030-
result.error("Failed to get `surface` from `Camera2Capturer`", null, null);
1030+
result.error(null, "Failed to get `surface` from `Camera2Capturer`", null);
10311031
return;
10321032
} catch (IllegalAccessException e) {
10331033
// Should never happen since we are calling `setAccessible(true)`
@@ -1042,7 +1042,7 @@ void setTorch(String trackId, boolean torch, Result result) {
10421042
} catch (NoSuchFieldException e) {
10431043
// Most likely the upstream Camera2Capturer class have changed
10441044
Log.e(TAG, "[TORCH] Failed to get `cameraThreadHandler` from `Camera2Capturer`");
1045-
result.error("Failed to get `cameraThreadHandler` from `Camera2Capturer`", null, null);
1045+
result.error(null, "Failed to get `cameraThreadHandler` from `Camera2Capturer`", null);
10461046
return;
10471047
} catch (IllegalAccessException e) {
10481048
// Should never happen since we are calling `setAccessible(true)`
@@ -1078,7 +1078,7 @@ void setTorch(String trackId, boolean torch, Result result) {
10781078
} catch (NoSuchFieldException e) {
10791079
// Most likely the upstream Camera1Capturer class have changed
10801080
Log.e(TAG, "[TORCH] Failed to get `currentSession` from `Camera1Capturer`");
1081-
result.error("Failed to get `currentSession` from `Camera1Capturer`", null, null);
1081+
result.error(null, "Failed to get `currentSession` from `Camera1Capturer`", null);
10821082
return;
10831083
} catch (IllegalAccessException e) {
10841084
// Should never happen since we are calling `setAccessible(true)`
@@ -1093,7 +1093,7 @@ void setTorch(String trackId, boolean torch, Result result) {
10931093
} catch (NoSuchFieldException e) {
10941094
// Most likely the upstream Camera1Session class have changed
10951095
Log.e(TAG, "[TORCH] Failed to get `camera` from `Camera1Session`");
1096-
result.error("Failed to get `camera` from `Camera1Session`", null, null);
1096+
result.error(null, "Failed to get `camera` from `Camera1Session`", null);
10971097
return;
10981098
} catch (IllegalAccessException e) {
10991099
// Should never happen since we are calling `setAccessible(true)`
@@ -1109,6 +1109,6 @@ void setTorch(String trackId, boolean torch, Result result) {
11091109
}
11101110

11111111
Log.e(TAG, "[TORCH] Video capturer not compatible");
1112-
result.error("Video capturer not compatible", null, null);
1112+
result.error(null, "Video capturer not compatible", null);
11131113
}
11141114
}

0 commit comments

Comments
 (0)
0