Skip to content
Snippets Groups Projects
Commit d08e0130 authored by Andre Sailer's avatar Andre Sailer
Browse files

DDSim: Userfunction: catch and log exceptions

parent c417b5be
No related branches found
No related tags found
No related merge requests found
...@@ -5,8 +5,11 @@ import os ...@@ -5,8 +5,11 @@ import os
from DDSim.Helper.ConfigHelper import ConfigHelper from DDSim.Helper.ConfigHelper import ConfigHelper
from g4units import mm from g4units import mm
import logging
import ddsix as six import ddsix as six
logger = logging.getLogger(__name__)
class Physics(ConfigHelper): class Physics(ConfigHelper):
"""Configuration for the PhysicsList""" """Configuration for the PhysicsList"""
...@@ -139,7 +142,11 @@ class Physics(ConfigHelper): ...@@ -139,7 +142,11 @@ class Physics(ConfigHelper):
rg.RangeCut = self.rangecut rg.RangeCut = self.rangecut
for func in self._userFunctions: for func in self._userFunctions:
func(kernel) try:
func(kernel)
except Exception as e:
logger.error("Exception in UserFunction: %r", e)
raise RuntimeError("Exception in UserFunction: %r" % e)
return seq return seq
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment