Skip to content

Commit 689b5bc

Browse files
committed
fix(logging[builder]): add script path to before_script error extra
why: The bare error message loses the script path, making it harder to diagnose which before_script failed in structured log systems. what: - Add tmux_config_path extra with the before_script path to error log
1 parent 16fb89a commit 689b5bc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/tmuxp/workspace/builder.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,14 @@ def build(self, session: Session | None = None, append: bool = False) -> None:
366366
)
367367
run_before_script(self.session_config["before_script"], cwd=cwd)
368368
except Exception:
369-
_log.error("before script failed")
369+
_log.error(
370+
"before script failed",
371+
extra={
372+
"tmux_config_path": str(
373+
self.session_config["before_script"],
374+
),
375+
},
376+
)
370377
self.session.kill()
371378
raise
372379

0 commit comments

Comments
 (0)