iqm-exa-common 26.22.0__py3-none-any.whl → 26.23.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,9 +94,15 @@ _STATUS_CODE_TO_ERROR_MAPPING = {value: key for key, value in _ERROR_TO_STATUS_C
94
94
 
95
95
  def map_from_error_to_status_code(error: StationControlError) -> HTTPStatus:
96
96
  """Map a StationControlError to an HTTPStatus code."""
97
- return _ERROR_TO_STATUS_CODE_MAPPING.get(type(error), HTTPStatus.INTERNAL_SERVER_ERROR)
97
+ direct_mapping = _ERROR_TO_STATUS_CODE_MAPPING.get(type(error))
98
+ if direct_mapping is not None:
99
+ return direct_mapping
100
+ for error_type, status_code in _ERROR_TO_STATUS_CODE_MAPPING.items():
101
+ if isinstance(error, error_type):
102
+ return status_code
103
+ return HTTPStatus.INTERNAL_SERVER_ERROR
98
104
 
99
105
 
100
- def map_from_status_code_to_error(status_code: HTTPStatus) -> StationControlError:
106
+ def map_from_status_code_to_error(status_code: HTTPStatus) -> type[StationControlError]:
101
107
  """Map an HTTPStatus code to a StationControlError."""
102
108
  return _STATUS_CODE_TO_ERROR_MAPPING.get(status_code, InternalServerError)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-exa-common
3
- Version: 26.22.0
3
+ Version: 26.23.0
4
4
  Summary: Framework for control and measurement of superconducting qubits: common library
5
5
  Author-email: IQM Finland Oy <info@meetiqm.com>
6
6
  License: Apache License
@@ -31,7 +31,7 @@ exa/common/data/settingnode_v2.html.jinja2,sha256=mo-rlLLmU-Xxf6znJAisispAZK8sbV
31
31
  exa/common/data/value.py,sha256=mtMws5UPGx1pCADK6Q2Tx4BwCXznvVRSNQRfcQ3NMmY,1853
32
32
  exa/common/errors/__init__.py,sha256=ArMBdpmx1EUenBpzrSNG63kmUf7PM0gCqSYnaCnL9Qk,597
33
33
  exa/common/errors/exa_error.py,sha256=iw8ueZgqx1JXkfjRoJfPUsSE7cfhzIWpdDaFuka9Ss0,990
34
- exa/common/errors/station_control_errors.py,sha256=X6tpbwuOkbt90Ff2LYMzecO3xyqnEbkXa_OKDe9guaE,3884
34
+ exa/common/errors/station_control_errors.py,sha256=NEVW9QC-jJM36CQ8b9IIg9hZv5Utph9LXirxk5ZiuNM,4122
35
35
  exa/common/helpers/__init__.py,sha256=IgtVD3tojIFA4MTV2mT5uYM6jb2qny9kBIIhEZT2PuI,610
36
36
  exa/common/helpers/data_helper.py,sha256=qg-RBCGGP947IbZAoFQ0oQrmp2EgzCSgh6kinX2MD9A,1903
37
37
  exa/common/helpers/deprecation.py,sha256=nY8484iun63JOBfBeh49Q6VD5xZ4_gT9fjPmH1RAXoI,397
@@ -50,8 +50,8 @@ exa/common/qcm_data/qcm_data_client.py,sha256=v8gW-nAYxCdVEO4Uncl3DwH85D67Gi2n2a
50
50
  exa/common/sweep/__init__.py,sha256=uEKk5AtzSgSnf8Y0geRPwUpqXIBIXpeCxsN64sX7F1o,591
51
51
  exa/common/sweep/database_serialization.py,sha256=NUu1umxRQZpKtRmw1vNDsSbnofqbHvKFg_xQ2mdhY6k,7469
52
52
  exa/common/sweep/util.py,sha256=-QE2AaH-WDkYAVH5-Z-30leLgY0x4efmby4kc1JTCgY,3732
53
- iqm_exa_common-26.22.0.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
54
- iqm_exa_common-26.22.0.dist-info/METADATA,sha256=YcBxQYvOgF8TiDCF9ybkdZbSX-uePunR6AxRk8n-_JQ,14629
55
- iqm_exa_common-26.22.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
56
- iqm_exa_common-26.22.0.dist-info/top_level.txt,sha256=Clphg2toaZ3_jSFRPhjMNEmLurkMNMc4lkK2EFYsSlM,4
57
- iqm_exa_common-26.22.0.dist-info/RECORD,,
53
+ iqm_exa_common-26.23.0.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
54
+ iqm_exa_common-26.23.0.dist-info/METADATA,sha256=A_U9ew0QZxte2FokRXml1Vll5dY1Kd1B-gxp9FWesUU,14629
55
+ iqm_exa_common-26.23.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
56
+ iqm_exa_common-26.23.0.dist-info/top_level.txt,sha256=Clphg2toaZ3_jSFRPhjMNEmLurkMNMc4lkK2EFYsSlM,4
57
+ iqm_exa_common-26.23.0.dist-info/RECORD,,