Move things around slightly so the compiler can track cc
diff --git a/tests/encperf.cxx b/tests/encperf.cxx
index bbaa8fb..6b1119a 100644
--- a/tests/encperf.cxx
+++ b/tests/encperf.cxx
@@ -339,7 +339,12 @@
 
   try {
     cc = new CConn(fn);
+  } catch (rdr::Exception e) {
+    fprintf(stderr, "Failed to open rfb file: %s\n", e.str());
+    exit(1);
+  }
 
+  try {
     while (true)
       cc->processMsg();
   } catch (rdr::EndOfStream e) {