Skip to main content

log the error

ID
d12b7fe
date
2022-10-16 21:49:57+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
dc4e3c2
message
log the error
changed files
1 file, 8 additions, 1 deletion

Changed files

src/get_bytes.rs (3819) → src/get_bytes.rs (3938)

diff --git a/src/get_bytes.rs b/src/get_bytes.rs
index 530459c..67ba4d3 100644
--- a/src/get_bytes.rs
+++ b/src/get_bytes.rs
@@ -53,7 +53,14 @@ pub fn get_bytes_for_gif(path: &str) -> Vec<u8> {
     //
     // For that reason, we select a sample of up to 50 frames and use those
     // as the basis for analysis.
-    let frames: Vec<Frame> = decoder.into_frames().collect_frames().unwrap();
+    let frames: Vec<Frame> = match decoder.into_frames().collect_frames() {
+        Ok(f) => f,
+        Err(e) => {
+            println!("{:?}", e);
+            panic!("BOOM!");
+        },
+
+    };
 
     // How this works: it tells us we should be looking at the nth frame.
     // Examples: