Skip to content

Commit d0e340a

Browse files
committed
Better message by using same traceback
1 parent 197cf1c commit d0e340a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

datastream/dataset.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,14 @@ def composed_fn(dataframe, index):
138138

139139
raise Exception('\n'.join([
140140
repr(e),
141-
'Above exception occured in the pipeline for',
142-
'item:',
143-
item_text,
141+
'',
142+
'Above exception originated from',
144143
f'module: {inspect.getmodule(function)}',
145-
'source:',
144+
'from mapped function:',
146145
inspect.getsource(function),
147-
])) from e
146+
'for item:',
147+
item_text,
148+
])).with_traceback(e.__traceback__)
148149

149150
return Dataset(
150151
dataframe=self.dataframe,

0 commit comments

Comments
 (0)