Skip to content

Commit 23b9bc0

Browse files
Zsailerclaude
andcommitted
Improve error messaging and string formatting consistency
- Use f-strings consistently throughout timeout error handling - Add more specific error messages including PID for credential daemon cleanup - Improve git command failure logging with more descriptive messages - Include timeout error details in warning logs for better debugging 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent d58ff6f commit 23b9bc0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jupyterlab_git/git.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ def call_subprocess(
228228
except TimeoutError as e:
229229
# Handle our custom timeout errors
230230
code, output, error = -1, "", str(e)
231-
get_logger().warning("Git command timed out: {!s}".format(cmdline))
231+
get_logger().warning(f"Git command timed out: {cmdline} - {str(e)}")
232232
except BaseException as e:
233233
code, output, error = -1, "", traceback.format_exc()
234-
get_logger().warning("Fail to execute {!s}".format(cmdline), exc_info=True)
234+
get_logger().warning(f"Failed to execute git command: {cmdline}", exc_info=True)
235235
finally:
236236
execution_lock.release()
237237

@@ -272,7 +272,7 @@ def _cleanup_processes(self):
272272
except subprocess.TimeoutExpired:
273273
self._GIT_CREDENTIAL_CACHE_DAEMON_PROCESS.kill()
274274
self._GIT_CREDENTIAL_CACHE_DAEMON_PROCESS.wait()
275-
get_logger().debug("Git credential cache daemon process cleaned up")
275+
get_logger().debug(f"Git credential cache daemon process (PID: {self._GIT_CREDENTIAL_CACHE_DAEMON_PROCESS.pid}) cleaned up successfully")
276276
except Exception as e:
277277
get_logger().warning(f"Failed to cleanup credential cache daemon: {e}")
278278
finally:

0 commit comments

Comments
 (0)