From b4ac087f5bbf42d30a5c3b6156601a087d4ad077 Mon Sep 17 00:00:00 2001
From: Tim O'Donnell <timodonnell@gmail.com>
Date: Sat, 4 Jan 2020 18:44:50 -0500
Subject: [PATCH] fix

---
 mhcflurry/cluster_parallelism.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/mhcflurry/cluster_parallelism.py b/mhcflurry/cluster_parallelism.py
index 10eccdad..90cae6ca 100644
--- a/mhcflurry/cluster_parallelism.py
+++ b/mhcflurry/cluster_parallelism.py
@@ -290,9 +290,14 @@ def cluster_results(
             if os.path.exists(error_path) or not os.path.exists(result_path):
                 if os.path.exists(error_path):
                     print("Error path exists", error_path)
-                    with open(error_path, "rb") as fd:
-                        exception = pickle.load(fd)
-                        print(exception)
+                    try:
+                        with open(error_path, "rb") as fd:
+                            exception = pickle.load(fd)
+                            print(exception)
+                    except Exception as e:
+                        exception = RuntimeError(
+                            "Error, but couldn't read error path: %s %s" % (
+                                type(e), str(e)))
                 else:
                     exception = RuntimeError("Error, but no exception saved")
                 if not os.path.exists(result_path):
-- 
GitLab