2626from proxystore .connectors .protocols import DeferrableConnector
2727from proxystore .proxy import Proxy
2828from proxystore .proxy import ProxyLocker
29+ from proxystore .serialize import SerializationError
2930from proxystore .store .cache import LRUCache
3031from proxystore .store .exceptions import NonProxiableTypeError
3132from proxystore .store .factory import PollingStoreFactory
3940from proxystore .store .types import ConnectorT
4041from proxystore .store .types import DeserializerT
4142from proxystore .store .types import SerializerT
42- from proxystore .utils .imports import get_class_path
43- from proxystore .utils .imports import import_class
43+ from proxystore .utils .imports import get_object_path
44+ from proxystore .utils .imports import import_from_path
4445from proxystore .utils .timer import Timer
4546from proxystore .warnings import ExperimentalWarning
4647
@@ -190,7 +191,7 @@ def config(self) -> dict[str, Any]:
190191 """
191192 return {
192193 'name' : self .name ,
193- 'connector_type' : get_class_path (type (self .connector )),
194+ 'connector_type' : get_object_path (type (self .connector )),
194195 'connector_config' : self .connector .config (),
195196 'serializer' : self ._serializer ,
196197 'deserializer' : self ._deserializer ,
@@ -211,7 +212,7 @@ def from_config(cls, config: dict[str, Any]) -> Store[Any]:
211212 config = config .copy () # Avoid messing with callers version
212213 connector_type = config .pop ('connector_type' )
213214 connector_config = config .pop ('connector_config' )
214- connector = import_class (connector_type )
215+ connector = import_from_path (connector_type )
215216 config ['connector' ] = connector .from_config (connector_config )
216217 return cls (** config )
217218
@@ -409,6 +410,10 @@ def get(
409410
410411 Returns:
411412 Object or `None` if the object does not exist.
413+
414+ Raises:
415+ SerializationError: If an exception is caught when deserializing
416+ the object associated with the key.
412417 """
413418 timer = Timer ()
414419 timer .start ()
@@ -437,10 +442,19 @@ def get(
437442
438443 if value is not None :
439444 with Timer () as deserializer_timer :
440- if deserializer is not None :
445+ deserializer = (
446+ deserializer
447+ if deserializer is not None
448+ else self .deserializer
449+ )
450+ try :
441451 result = deserializer (value )
442- else :
443- result = self .deserializer (value )
452+ except Exception as e :
453+ name = get_object_path (deserializer )
454+ raise SerializationError (
455+ 'Failed to deserialize object '
456+ f'(deserializer={ name } , key={ key } ).' ,
457+ ) from e
444458
445459 if self .metrics is not None :
446460 dtime = deserializer_timer .elapsed_ns
0 commit comments