From a706db53859fe28ab22ba7c4bab28056f2b9a0d6 Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Tue, 7 Jan 2025 12:45:27 -0500 Subject: [PATCH] fixup: raise from --- api/src/opentrons/protocols/labware.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/src/opentrons/protocols/labware.py b/api/src/opentrons/protocols/labware.py index ddd8e630250..ec05e3cbb72 100644 --- a/api/src/opentrons/protocols/labware.py +++ b/api/src/opentrons/protocols/labware.py @@ -169,21 +169,21 @@ def verify_definition( # noqa: C901 try: to_return = json.loads(contents) except json.JSONDecodeError as e: - raise NotALabwareError("invalid-json", [e]) + raise NotALabwareError("invalid-json", [e]) from e try: schema_version = to_return["schemaVersion"] except KeyError as e: - raise NotALabwareError("no-schema-id", [e]) + raise NotALabwareError("no-schema-id", [e]) from e try: schema = schemata_by_version[schema_version] except KeyError as e: - raise NotALabwareError("bad-schema-id", [e]) + raise NotALabwareError("bad-schema-id", [e]) from e try: jsonschema.validate(to_return, schema) except jsonschema.ValidationError as e: - raise NotALabwareError("schema-mismatch", [e]) + raise NotALabwareError("schema-mismatch", [e]) from e # we can type ignore this because if it passes the jsonschema it has # the correct structure