Skip to content

fix: improve error logging and remove token secret from logs#685

Merged
alexhancock merged 1 commit intomainfrom
improve-error-logging
Feb 26, 2026
Merged

fix: improve error logging and remove token secret from logs#685
alexhancock merged 1 commit intomainfrom
improve-error-logging

Conversation

@DaleSeo
Copy link
Member

@DaleSeo DaleSeo commented Feb 24, 2026

Motivation and Context

Quick follow-up to #680 to make a few small fixes/improvements:

  • debug!("refresh token: {:?}", refresh_token) was logging the refresh token secret, which should never appear in logs
  • When try_refresh_or_reauth catches TokenRefreshFailed, the original reason was discarded from both the error and the log, making refresh failures harder to diagnose
  • The skip-expiry-check path when token_received_at is None was correct but non-obvious without a comment

How Has This Been Tested?

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@DaleSeo DaleSeo self-assigned this Feb 24, 2026
@github-actions github-actions bot added T-core Core library changes T-transport Transport layer changes labels Feb 24, 2026
@DaleSeo DaleSeo marked this pull request as ready for review February 25, 2026 14:30
@DaleSeo DaleSeo requested a review from a team as a code owner February 25, 2026 14:30
@alexhancock alexhancock merged commit b967c13 into main Feb 26, 2026
16 checks passed
@alexhancock alexhancock deleted the improve-error-logging branch February 26, 2026 15:05
This was referenced Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants