Support JSON output for top-level RuntimeError