saip.batch: log parameter errors

Change-Id: I6a46b2dc9018078ab8361226d1e6b50d3b4e1aaa
This commit is contained in:
Neels Hofmeyr
2026-04-09 22:10:14 +02:00
parent 7362525f8e
commit 26ea0d1656
+9
View File
@@ -20,6 +20,9 @@
import copy import copy
import pprint import pprint
import logging
import traceback
import inspect
from typing import Generator, Union from typing import Generator, Union
from pySim.esim.saip.personalization import ConfigurableParameter from pySim.esim.saip.personalization import ConfigurableParameter
from pySim.esim.saip import param_source from pySim.esim.saip import param_source
@@ -27,6 +30,10 @@ from pySim.esim.saip import ProfileElementSequence, ProfileElementSD
from pySim.global_platform import KeyUsageQualifier from pySim.global_platform import KeyUsageQualifier
from osmocom.utils import b2h from osmocom.utils import b2h
logger = logging.getLogger(__name__)
def _func_():
return inspect.currentframe().f_back.f_code.co_name
# a list of ConfigurableParameter classes and/or ConfigurableParameter class instances # a list of ConfigurableParameter classes and/or ConfigurableParameter class instances
ParamList = list[Union[type[ConfigurableParameter], ConfigurableParameter]] ParamList = list[Union[type[ConfigurableParameter], ConfigurableParameter]]
@@ -121,6 +128,8 @@ class BatchPersonalization:
value = p.param_cls.validate_val(input_value) value = p.param_cls.validate_val(input_value)
p.param_cls.apply_val(pes, value) p.param_cls.apply_val(pes, value)
except Exception as e: except Exception as e:
print(traceback.format_exc())
logger.error('during %s: %r', _func_(), e)
raise ValueError(f'{p.param_cls.get_name()} fed by {p.src.name}: {e}') from e raise ValueError(f'{p.param_cls.get_name()} fed by {p.src.name}: {e}') from e
pes.rebuild_mandatory_services() pes.rebuild_mandatory_services()