diff --git a/bob/io/image/cpp/gif.cpp b/bob/io/image/cpp/gif.cpp
index e6cb0b4baccf61e67b02425529f6a8b428d63fe8..50eb484970aec1dace92980efffdda4c8ea28547 100644
--- a/bob/io/image/cpp/gif.cpp
+++ b/bob/io/image/cpp/gif.cpp
@@ -481,7 +481,7 @@ static void im_load_color(boost::shared_ptr<GifFileType> in_file, bob::io::base:
   } while (!terminated);
 
   if (!image_found){
-    std::runtime_error("GIF: image does not contain an image section");
+    throw std::runtime_error("GIF: image does not contain an image section");
   }
 
   // Lets dump it - set the global variables required and do it: