Skip to content

Commit

Permalink
fix: format and wrong unpacking
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 committed Aug 8, 2024
1 parent 6f566d7 commit 42c0eb1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ansys/mapdl/core/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def handle_generic_grpc_error(error, func, args, kwargs):
# can't use isinstance here due to circular imports
try:
class_name = args[0].__class__.__name__
except:
except (IndexError, AttributeError):
class_name = ""

# trying to get "cmd" argument:
Expand All @@ -360,19 +360,19 @@ def handle_generic_grpc_error(error, func, args, kwargs):
caller = func.__name__

if cmd:
msg_ = f"running:\n\t{cmd}\ncalled by:\n\t{caller}\n"
msg_ = f"running:\n {cmd}\ncalled by:\n {caller}\n"
else:
msg_ = f"calling:{caller}\nwith the following arguments:\nargs: {list(*args)}\nkwargs: {list(**kwargs_)}"
msg_ = f"calling:{caller}\nwith the following arguments:\n args: {args}\n kwargs: {kwargs}"

if class_name == "MapdlGrpc":
mapdl = args[0]
elif hasattr(args[0], "_mapdl"):
mapdl = args[0]._mapdl

msg = (
f"MAPDL server connection terminated unexpectedly while {msg_}\n"
f"Error:\nMAPDL server connection terminated unexpectedly while {msg_}\n"
"Error:\n"
f"\t{error.details()}\n"
f" {error.details()}\n"
f"Full error:\n{error}"
)

Expand Down

0 comments on commit 42c0eb1

Please sign in to comment.