Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions src/python/nimbusml/internal/utils/entrypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,14 @@ def nimbusml_runnable_graph(self):
'"nodes"',
'"Nodes"')

def _parse_bridge_runtime_exception(self, exception_message):
r = exception_message.split("StackTrace: ", 1)
msg = r[0]
callstack = None
if len(r) > 1:
callstack = r[1]
return msg, callstack

def _try_call_bridge(
self,
px_call,
Expand All @@ -281,6 +289,7 @@ def _try_call_bridge(
try:
ret = px_call(call_parameters)
except RuntimeError as e:
msg, callstack = self._parse_bridge_runtime_exception(str(e))
if verbose:
vars = '?'
if "data" in call_parameters:
Expand All @@ -298,16 +307,14 @@ def _try_call_bridge(
vars = "type={0} keys={1}".format(
type(od), ','.join(od))
if isinstance(verbose, six.integer_types) and verbose >= 2:
raise BridgeRuntimeError(
"{0}.\n--GRAPH--\n{1}\n--DATA--\n{2}"
"\n--\nconcatenated={3}".format(
str(e), str(self), vars, concatenated),
model=output_modelfilename)
raise BridgeRuntimeError(msg, callstack=callstack, graph=str(self), vars=vars,
concatenated=concatenated,
model=output_modelfilename)
else:
raise BridgeRuntimeError(
str(e), model=output_modelfilename)
raise BridgeRuntimeError(msg=msg, callstack=callstack,
model=output_modelfilename)
else:
raise e
raise BridgeRuntimeError(msg=msg, callstack=callstack)
return ret

def _get_separator(self):
Expand Down