Skip to content

Commit

Permalink
Add trace stack on error occur
Browse files Browse the repository at this point in the history
  • Loading branch information
Dang Ly committed Nov 18, 2024
1 parent bb52d08 commit 9eb67e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion datamimic_ce/datamimic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).
# For commercial use, please contact Rapiddweller at [email protected] to obtain a commercial license.
# Full license text available at: http://creativecommons.org/licenses/by-nc-sa/4.0/

import traceback
import uuid
from pathlib import Path

Expand Down Expand Up @@ -72,6 +72,7 @@ def parse_and_execute(self) -> None:
raise e
except Exception as err:
logger.exception("Error in DATAMIMIC process. Error message: {err}")
traceback.print_exc()
raise err

def capture_test_result(self) -> dict | None:
Expand Down
2 changes: 1 addition & 1 deletion datamimic_ce/tasks/key_variable_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def _generate_value(self, ctx: GenIterContext):
else ctx.evaluate_python_expression(self._statement.default_value)
)
else:
raise ValueError(f"Failed when execute script of element " f"'{self._statement.name}'") from e
raise ValueError(f"Failed when execute script of element " f"'{self._statement.name}': {str(e)}") from e
# Throw error if <key> evaluated script get not simple data type
if (
self._element_tag == "key"
Expand Down

0 comments on commit 9eb67e1

Please sign in to comment.