forked from public/pysim
saip.batch: log parameter errors
Change-Id: I6a46b2dc9018078ab8361226d1e6b50d3b4e1aaa
This commit is contained in:
@@ -20,6 +20,9 @@
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
import pprint
|
import pprint
|
||||||
|
import logging
|
||||||
|
import traceback
|
||||||
|
import inspect
|
||||||
from typing import List, Generator
|
from typing import List, Generator
|
||||||
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
|
||||||
|
|
||||||
class BatchPersonalization:
|
class BatchPersonalization:
|
||||||
"""Produce a series of eSIM profiles from predefined parameters.
|
"""Produce a series of eSIM profiles from predefined parameters.
|
||||||
Personalization parameters are derived from pysim.esim.saip.param_source.ParamSource.
|
Personalization parameters are derived from pysim.esim.saip.param_source.ParamSource.
|
||||||
@@ -115,7 +122,9 @@ class BatchPersonalization:
|
|||||||
value = p.param.__class__.validate_val(input_value)
|
value = p.param.__class__.validate_val(input_value)
|
||||||
p.param.__class__.apply_val(pes, value)
|
p.param.__class__.apply_val(pes, value)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise ValueError(f'{p.param.name} fed by {p.src.name}: {e}') from e
|
print(traceback.format_exc())
|
||||||
|
logger.error('during %s: %r', _func_(), e)
|
||||||
|
raise ValueError(f'{p.param.name} fed by {p.src.name}: {e!r}') from e
|
||||||
|
|
||||||
yield pes
|
yield pes
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user