Skip to content

Commit

Permalink
Add stacktrace to exception message.
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajtickoo committed Nov 18, 2024
1 parent 1cd8b61 commit 7b35ea3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rpe/engines/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import importlib.util
import inspect
import sys
import traceback

from dataclasses import asdict

Expand Down Expand Up @@ -114,8 +115,9 @@ def evaluate(self, resource):

# These are user-provided modules, we need to catch any exception
except Exception as e:
print(f"Evaluation exception. Policy: {policy_name}, Message: {str(e)}")

print("Evaluation exception. Policy: {0}, Message: {1}, Exception Stacktrace: {2}".format(
policy_name, repr(e), traceback.format_exc()
))
return evals

def _legacy_eval(self, resource, policy_name, policy_cls):
Expand Down

0 comments on commit 7b35ea3

Please sign in to comment.