load_port(config) that reads config['port'] and converts it to int, but translates ANY failure (missing key or bad value) into a single RuntimeError('invalid config') chained to the original using raise ... from err — so tracebacks show both the friendly error and the root cause.load_port({'port': 'abc'})RuntimeError: invalid config (chained from ValueError)
The from clause preserves the original as __cause__.
except (A, B) as err: groups the types.
The from keyword sets __cause__ on the new exception.