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
2 changes: 1 addition & 1 deletion iwf/worker_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def internal_error(exception):
return _worker_service.handle_worker_error(exception), 500
"""
stacktrace = traceback.format_exc()
index = stacktrace.index("iwf-python-sdk/iwf/worker_service.py")
index = max(0, stacktrace.find("iwf-python-sdk/iwf/worker_service.py"))
return "WorkerExecutionError: {0}; StackTrace:{1}".format(
exception, stacktrace[index:]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean full stacktrace will be returned if no iwf-python-sdk/iwf/worker_service.py found?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct. find will return -1 if the file isn't found, so use 0, and the string slice will include the full stacktrace.

)
Expand Down