Remove exception handling from _consumeCommnad() 55/287255/1
authorChanggyu Choi <changyu.choi@samsung.com>
Thu, 26 Jan 2023 00:57:00 +0000 (09:57 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Thu, 26 Jan 2023 00:57:00 +0000 (09:57 +0900)
This patch removes the catch clause so that the parcel parsing error
can be propagated to the user code (as an unhandled exception) properly.

Change-Id: Id7e7bc1d11061a5140c51fde156873618fde712c
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
idlc/gen/dart_proxy_gen_cb.h

index 4184c58..4ee55cc 100644 (file)
@@ -81,17 +81,13 @@ class <INTERFACE_NAME> extends ProxyBase {
   }
 
   Parcel _consumeCommand(Port port) {
-    try {
-      final Parcel parcel = Parcel.fromPort(port);
-      final int cmd = parcel.readInt32();
-      if (cmd != _MethodId.result.id) {
-        print('Received parcel is invalid. $cmd');
-      }
-      return parcel;
-    } catch (error) {
-      print(error.toString());
-      return Parcel();
+    final Parcel parcel = Parcel.fromPort(port);
+    final int cmd = parcel.readInt32();
+    if (cmd != _MethodId.result.id) {
+      print('Received parcel is invalid. $cmd');
     }
+
+    return parcel;
   }
 
   /// Disposes of registered delegate interface.