FA-5251 / Exception flow / Open access
Exception chaining metadata: Reraises the original exception instead of the requested wrapper · case 01
Reraises the original exception instead of the requested wrapper and changes the required Python-language result.
ROOT CAUSE
Reraises the original exception instead of the requested wrapper. The executable reproducer isolates this operation from the rest of the contract.
VERIFIED REPAIR
Wrap ValueError in RuntimeError with implicit, explicit, or from-None chaining. Return [error type,cause type or None,context type or None,suppress-context flag]. Suppressing displayed context does not erase __context__.
Unsuccessful approach: The alternative still fails because it raises the wrapper without its requested explicit cause.
Case contract
Wrap ValueError in RuntimeError with implicit, explicit, or from-None chaining. Return [error type,cause type or None,context type or None,suppress-context flag]. Suppressing displayed context does not erase __context__. Inputs use the finite Python types shown in the fixtures. An error string denotes the specified caught exception, not an unhandled process failure.
Why this case matters
Runs Python standard-library language operations in a deterministic local reproducer. Literal expected answers are authored independently. Related defects share an evaluation group to avoid benchmark split leakage.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(mode):
try:
try:
raise ValueError('original')
except ValueError as original:
error=RuntimeError('wrapper')
if mode=='explicit':
raise
elif mode=='suppressed':
raise
else:
raise
except BaseException as caught:
pass
return [type(caught).__name__, None if caught.__cause__ is None else type(caught.__cause__).__name__, None if caught.__context__ is None else type(caught.__context__).__name__, caught.__suppress_context__]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('explicit cause', solve('explicit'), ['RuntimeError', 'ValueError', 'ValueError', True])
check('suppressed display', solve('suppressed'), ['RuntimeError', None, 'ValueError', True])
check('implicit context', solve('implicit'), ['RuntimeError', None, 'ValueError', False])
check('default path remains implicit', solve('other'), ['RuntimeError', None, 'ValueError', False])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit cause | ['ValueError', None, None, False] | ['RuntimeError', 'ValueError', 'ValueError', True] | Failed |
| suppressed display | ['ValueError', None, None, False] | ['RuntimeError', None, 'ValueError', True] | Failed |
| implicit context | ['ValueError', None, None, False] | ['RuntimeError', None, 'ValueError', False] | Failed |
| default path remains implicit | ['ValueError', None, None, False] | ['RuntimeError', None, 'ValueError', False] | Failed |
SHA-256 / b62386b5d839b8fd1ef2f6195e26d77d2cb23ebc6b4b89311f39f049e3a920cc
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(mode):
try:
try:
raise ValueError('original')
except ValueError as original:
error=RuntimeError('wrapper')
if mode=='explicit':
raise error
elif mode=='suppressed':
raise error from None
else:
raise error
except BaseException as caught:
pass
return [type(caught).__name__, None if caught.__cause__ is None else type(caught.__cause__).__name__, None if caught.__context__ is None else type(caught.__context__).__name__, caught.__suppress_context__]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('explicit cause', solve('explicit'), ['RuntimeError', 'ValueError', 'ValueError', True])
check('suppressed display', solve('suppressed'), ['RuntimeError', None, 'ValueError', True])
check('implicit context', solve('implicit'), ['RuntimeError', None, 'ValueError', False])
check('default path remains implicit', solve('other'), ['RuntimeError', None, 'ValueError', False])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit cause | ['RuntimeError', None, 'ValueError', False] | ['RuntimeError', 'ValueError', 'ValueError', True] | Failed |
| suppressed display | ['RuntimeError', None, 'ValueError', True] | ['RuntimeError', None, 'ValueError', True] | Passed |
| implicit context | ['RuntimeError', None, 'ValueError', False] | ['RuntimeError', None, 'ValueError', False] | Passed |
| default path remains implicit | ['RuntimeError', None, 'ValueError', False] | ['RuntimeError', None, 'ValueError', False] | Passed |
SHA-256 / a8b189773a9846614a97a77a4623d5fac339516dde46bb430efc4fdf6f5f14c7
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(mode):
try:
try:
raise ValueError('original')
except ValueError as original:
error=RuntimeError('wrapper')
if mode=='explicit':
raise error from original
elif mode=='suppressed':
raise error from None
else:
raise error
except BaseException as caught:
pass
return [type(caught).__name__, None if caught.__cause__ is None else type(caught.__cause__).__name__, None if caught.__context__ is None else type(caught.__context__).__name__, caught.__suppress_context__]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('explicit cause', solve('explicit'), ['RuntimeError', 'ValueError', 'ValueError', True])
check('suppressed display', solve('suppressed'), ['RuntimeError', None, 'ValueError', True])
check('implicit context', solve('implicit'), ['RuntimeError', None, 'ValueError', False])
check('default path remains implicit', solve('other'), ['RuntimeError', None, 'ValueError', False])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit cause | ['RuntimeError', 'ValueError', 'ValueError', True] | ['RuntimeError', 'ValueError', 'ValueError', True] | Passed |
| suppressed display | ['RuntimeError', None, 'ValueError', True] | ['RuntimeError', None, 'ValueError', True] | Passed |
| implicit context | ['RuntimeError', None, 'ValueError', False] | ['RuntimeError', None, 'ValueError', False] | Passed |
| default path remains implicit | ['RuntimeError', None, 'ValueError', False] | ['RuntimeError', None, 'ValueError', False] | Passed |
SHA-256 / f298b5850e85d1c41cef21ebfc85bc463d87ca117fcc39239a37d1937c35333e
Verification & scope
This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:37:47.624319+00:00.
Case digest / 56bf3df0662535c3d3df08a5ffe17f2ad6ca6b6e89aa423967c98cc26acaba46