Remove instances of 'raise Exception' (#7523)

This commit is contained in:
Edward Oakes
2020-03-10 17:51:22 -07:00
committed by GitHub
parent fdb528514b
commit 7b609ca211
13 changed files with 134 additions and 131 deletions
+7 -5
View File
@@ -397,7 +397,8 @@ class Node:
"""
if socket_path is not None:
if os.path.exists(socket_path):
raise Exception("Socket file {} exists!".format(socket_path))
raise RuntimeError(
"Socket file {} exists!".format(socket_path))
socket_dir = os.path.dirname(socket_path)
try_to_create_directory(socket_dir)
return socket_path
@@ -677,9 +678,10 @@ class Node:
# Handle the case where the process has already exited.
if process.poll() is not None:
if check_alive:
raise Exception("Attempting to kill a process of type "
"'{}', but this process is already dead."
.format(process_type))
raise RuntimeError(
"Attempting to kill a process of type "
"'{}', but this process is already dead."
.format(process_type))
else:
continue
@@ -696,7 +698,7 @@ class Node:
if process_info.stderr_file is not None:
with open(process_info.stderr_file, "r") as f:
message += "\nPROCESS STDERR:\n" + f.read()
raise Exception(message)
raise RuntimeError(message)
continue
if process_info.use_valgrind_profiler: