Skip to content

Conversation

@pinebit
Copy link
Collaborator

@pinebit pinebit commented Oct 22, 2025

app package errors revamp with claude.

category: refactor
ticket: #3882

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors error messages across the app package to follow consistent patterns. The changes improve clarity by removing subjective phrasing like "should" and "cannot," adopting more direct, action-oriented error descriptions.

Key Changes:

  • Standardized error message format from subjective assertions ("should match", "cannot read") to direct action descriptions ("mismatch", "read")
  • Updated error messages to be more concise and technically precise
  • Improved consistency in URL/address terminology (e.g., "bn addr" → "beacon node address")

Reviewed Changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
app/utils.go Updated directory/file comparison error messages to use direct terminology
app/utils_test.go Updated test expectations to match new error message format
app/tracer/trace.go Improved stdout trace exporter error message clarity
app/sse/client.go Standardized beacon node address parsing and HTTP response error messages
app/sse/client_internal_test.go Updated test to expect new response status error message
app/protonil/protonil.go Fixed grammar in field count error message
app/privkeylock/privkeylock.go Standardized private key lock file operation error messages
app/obolapi/*.go Consistent URL parsing and HTTP operation error messages across API files
app/k1util/k1util.go Improved clarity of scalar validation error message
app/eth2wrap/*.go Standardized validator data and proposal error messages
app/eth1wrap/runner.go Simplified eth1 client connection error messages
app/disk.go Standardized file operation error messages

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 22.50000% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.81%. Comparing base (8ad288b) to head (b037237).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
app/obolapi/exit.go 0.00% 7 Missing ⚠️
app/privkeylock/privkeylock.go 0.00% 5 Missing ⚠️
app/obolapi/api.go 0.00% 4 Missing ⚠️
app/disk.go 50.00% 3 Missing ⚠️
app/eth1wrap/runner.go 0.00% 2 Missing ⚠️
app/eth2wrap/valcache.go 0.00% 2 Missing ⚠️
app/sse/client.go 33.33% 2 Missing ⚠️
app/app.go 0.00% 1 Missing ⚠️
app/eth2wrap/eth2wrap.go 0.00% 1 Missing ⚠️
app/k1util/k1util.go 0.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4044      +/-   ##
==========================================
- Coverage   53.81%   53.81%   -0.01%     
==========================================
  Files         242      242              
  Lines       39425    39425              
==========================================
- Hits        21217    21215       -2     
- Misses      15965    15969       +4     
+ Partials     2243     2241       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: here I actually prefer the "cannot be" instead of "is", similar to "nickname cannot be..."

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree. If we change it here, we have to do in the other PRs as well. There was one with a lot of those changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Claude did that because there's no universal consensus, but the trend is to describe what IS wrong (state), not what action failed. It mentioned many sources like "Effective Go", but I totally agree we can set our own rules here. And since Kalo is the boss, I am modifying as suggested.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree. If we change it here, we have to do in the other PRs as well. There was one with a lot of those changes.

@pinebit pinebit force-pushed the pinebit/app-errors-revamp branch from 91f3c31 to 7601461 Compare October 23, 2025 10:22
@sonarqubecloud
Copy link

@pinebit pinebit added the merge when ready Indicates bulldozer bot may merge when all checks pass label Oct 23, 2025
@obol-bulldozer obol-bulldozer bot merged commit 1a76a1d into main Oct 23, 2025
11 checks passed
@obol-bulldozer obol-bulldozer bot deleted the pinebit/app-errors-revamp branch October 23, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge when ready Indicates bulldozer bot may merge when all checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants