Skip to content

chore: Prevent stack trace exposure in the tck error error response#2437

Merged
aceppaluni merged 5 commits into
hiero-ledger:mainfrom
manishdait:chore/tck-logging
Jul 14, 2026
Merged

chore: Prevent stack trace exposure in the tck error error response#2437
aceppaluni merged 5 commits into
hiero-ledger:mainfrom
manishdait:chore/tck-logging

Conversation

@manishdait

Copy link
Copy Markdown
Contributor

Description:
This PR silence error details in JSON-RPC error responses and improve logging for the errors.

Related issue(s):

Fixes #2416

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
@github-actions github-actions Bot added the approved Issue has been approved by team member label Jul 13, 2026
Comment thread tck/handlers/registry.py Fixed
Comment thread tck/handlers/registry.py Fixed
Comment thread tck/handlers/registry.py Fixed
Comment thread tck/handlers/registry.py Fixed
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
@manishdait
manishdait marked this pull request as ready for review July 13, 2026 17:12
@manishdait
manishdait requested a review from a team as a code owner July 13, 2026 17:12
@manishdait
manishdait requested a review from exploreriii July 13, 2026 17:12
@github-actions github-actions Bot added open to community review PR is open for community review and feedback queue:junior-committer PR awaiting initial quality review labels Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Updated SDK and registry error handling to add method-specific diagnostics and prevent unexpected exception details from appearing in JSON-RPC internal-error responses.

Changes

RPC error handling

Layer / File(s) Summary
SDK exception mapping
tck/errors.py
SDK exception logs now include handler names and updated exception details; mapped Hiero errors remain chained, while MaxAttemptsError and generic internal errors use default messages.
Registry dispatch diagnostics
tck/handlers/registry.py
Adds logging for missing methods, invalid parameters, and handled or unexpected exceptions while returning generic internal-error messages without exception data.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: preventing stack trace exposure in TCK error responses.
Description check ✅ Passed The description matches the changeset and describes silencing JSON-RPC error details and improving logging.
Linked Issues check ✅ Passed The changes align with #2416 by removing error detail from JSON-RPC responses and improving logging to avoid stack trace exposure.
Out of Scope Changes check ✅ Passed The edits stay focused on TCK error handling and logging, with no unrelated code paths introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: bd60ebbf-8efd-4879-9637-f89a2898fc51

📥 Commits

Reviewing files that changed from the base of the PR and between ec5baa2 and 9cfc080.

📒 Files selected for processing (2)
  • tck/errors.py
  • tck/handlers/registry.py

Comment thread tck/handlers/registry.py
aceppaluni
aceppaluni previously approved these changes Jul 13, 2026
@github-actions github-actions Bot added queue:maintainers PR awaiting maintainer final review and removed queue:junior-committer PR awaiting initial quality review labels Jul 13, 2026
exploreriii
exploreriii previously approved these changes Jul 14, 2026
@github-actions github-actions Bot added status: ready-to-merge PR has 1+ maintainer and 2+ total approvals, ready to merge and removed queue:maintainers PR awaiting maintainer final review labels Jul 14, 2026
Comment thread tck/errors.py Outdated
Comment thread tck/handlers/registry.py Outdated
@manishdait
manishdait dismissed stale reviews from exploreriii and aceppaluni via 0fa3ac4 July 14, 2026 08:37
@github-actions github-actions Bot added queue:junior-committer PR awaiting initial quality review and removed status: ready-to-merge PR has 1+ maintainer and 2+ total approvals, ready to merge labels Jul 14, 2026
Signed-off-by: Manish Dait <daitmanish88@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d104ec66-9e92-4ff1-b542-d297f001481e

📥 Commits

Reviewing files that changed from the base of the PR and between 0fa3ac4 and 9888edc.

📒 Files selected for processing (2)
  • tck/errors.py
  • tck/handlers/registry.py

Comment thread tck/handlers/registry.py
@github-actions github-actions Bot added queue:committers PR awaiting committer technical review and removed queue:junior-committer PR awaiting initial quality review labels Jul 14, 2026
@aceppaluni
aceppaluni merged commit 8f240d9 into hiero-ledger:main Jul 14, 2026
10 checks passed
@manishdait
manishdait deleted the chore/tck-logging branch July 20, 2026 08:10
@MonaaEid MonaaEid added this to the v0.2.9 milestone Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Issue has been approved by team member open to community review PR is open for community review and feedback queue:committers PR awaiting committer technical review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix CodeQL warning to prevent stack trace exposure in JSON-RPC responses

6 participants