Skip to content
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
18 changes: 12 additions & 6 deletions python/paddle/jit/dy2static/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,18 @@ def create_message(self):

# Simplify error value to improve readability if error is raised in runtime
if self.in_runtime:
if int(
os.getenv(SIMPLIFY_ERROR_ENV_NAME, DEFAULT_SIMPLIFY_NEW_ERROR)
):
self._simplify_error_value()
message_lines.append(str(self.error_value))
return '\n'.join(message_lines)
try:
if int(
os.getenv(
SIMPLIFY_ERROR_ENV_NAME, DEFAULT_SIMPLIFY_NEW_ERROR
)
):
self._simplify_error_value()
except:
pass
else:
message_lines.append(str(self.error_value))
return '\n'.join(message_lines)

# Step2: Optimizes stack information with source code information of dygraph from user.
user_code_traceback_index = []
Expand Down