Skip to content

Commit a298685

Browse files
committed
ENH: raises an error when user 'export_function' contains errors from any kind (attribute, logical, etc)
1 parent d411a22 commit a298685

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

rocketpy/simulation/monte_carlo.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,14 @@ def __export_flight_data(
372372
}
373373

374374
if self.export_function is not None:
375-
additional_exports = self.export_function(flight)
375+
try:
376+
additional_exports = self.export_function(flight)
377+
except Exception as e:
378+
raise ValueError(
379+
"An error was encountered running your custom export function. "
380+
"Check for errors in 'export_function' definition."
381+
) from e
382+
376383
for key in additional_exports.keys():
377384
if key in self.export_list:
378385
raise ValueError(

0 commit comments

Comments
 (0)