DemesneGH commented on code in PR #164:
URL: 
https://github.com/apache/incubator-teaclave-trustzone-sdk/pull/164#discussion_r1923020340


##########
examples/udp_socket-rs/ta/src/main.rs:
##########
@@ -74,13 +122,33 @@ fn udp_socket() {
                 response.extend_from_slice(&chunk[..n]);
                 break;
             }
-            Err(_) => {
-                trace_println!("Error");
-                panic!();
+            Err(err) => {
+                trace_println!("failed to read due to {:?}", err);
+                return Err(ErrorKind::Generic.into());
             }
         }
     }
     trace_println!("{}", String::from_utf8_lossy(&response));
+    Ok(())
 }
 
 include!(concat!(env!("OUT_DIR"), "/user_ta_header.rs"));
+
+/// Workaround for those rustc bugs:
+/// * https://github.com/rust-lang/rust/issues/47493

Review Comment:
   Have you tries this workaround in the issue? 
https://github.com/rust-lang/rust/issues/47493#issuecomment-606385776



##########
examples/udp_socket-rs/ta/src/main.rs:
##########
@@ -74,13 +122,33 @@ fn udp_socket() {
                 response.extend_from_slice(&chunk[..n]);
                 break;
             }
-            Err(_) => {
-                trace_println!("Error");
-                panic!();
+            Err(err) => {
+                trace_println!("failed to read due to {:?}", err);
+                return Err(ErrorKind::Generic.into());
             }
         }
     }
     trace_println!("{}", String::from_utf8_lossy(&response));
+    Ok(())
 }
 
 include!(concat!(env!("OUT_DIR"), "/user_ta_header.rs"));
+
+/// Workaround for those rustc bugs:
+/// * https://github.com/rust-lang/rust/issues/47493

Review Comment:
   Have you tried this workaround in the issue? 
https://github.com/rust-lang/rust/issues/47493#issuecomment-606385776



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@teaclave.apache.org
For additional commands, e-mail: dev-h...@teaclave.apache.org

Reply via email to