Use explicit chaining to capture the cause

This commit is contained in:
Sylvain Bellemare 2016-11-28 19:27:22 +01:00 committed by Sylvain Bellemare
parent b2f2ce3523
commit 96143f7e60

View File

@ -18,7 +18,7 @@ def validate_transaction_schema(tx_body):
try: try:
jsonschema.validate(tx_body, TX_SCHEMA) jsonschema.validate(tx_body, TX_SCHEMA)
except jsonschema.ValidationError as exc: except jsonschema.ValidationError as exc:
raise SchemaValidationError(str(exc)) raise SchemaValidationError(str(exc)) from exc
__all__ = ['TX_SCHEMA', 'TX_SCHEMA_YAML', 'validate_transaction_schema'] __all__ = ['TX_SCHEMA', 'TX_SCHEMA_YAML', 'validate_transaction_schema']