Skip to content

app startup error handling - #20941

Merged
krehermann merged 4 commits into
developfrom
chore/app-startup-errs
Jan 27, 2026
Merged

krehermann merged 4 commits into
developfrom
chore/app-startup-errs

Conversation

@krehermann

Copy link
Copy Markdown
Contributor

The intention is to remove the cryptic boot error 'not enabled', which occurs in the chainlink-evm lib when a chain or address is not properly configured.

To do this, is a simply matter of error wrapping around the relayer calls.

While in the neighborhood, I

  • updated all the unwrapped errors to have more context
  • removed the old style of errors.Wrap to fmt.Error(%w)
  • remove the depreciated pkg error lib altogether

Requires

Supports

@krehermann
krehermann requested review from a team as code owners January 27, 2026 17:28
Copilot AI review requested due to automatic review settings January 27, 2026 17:28
@krehermann
krehermann requested review from MStreet3 and removed request for vyzaldysanchez January 27, 2026 17:28
@github-actions

Copy link
Copy Markdown
Contributor

👋 krehermann, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

Copilot AI 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.

Pull request overview

This pull request improves error handling throughout the application's startup and lifecycle by replacing the deprecated github.com/pkg/errors package with standard library fmt.Errorf with %w verb for error wrapping. The PR aims to remove cryptic "not enabled" boot errors by adding context to all error messages, particularly around chain relayer initialization.

Changes:

  • Replaced all errors.Wrap calls with fmt.Errorf(...: %w, err) for consistent error wrapping
  • Added contextual information to all error messages to aid debugging
  • Removed the deprecated github.com/pkg/errors import
  • Added debug logging for OS arguments and configuration files

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
core/main.go Added debug output for OS arguments
core/cmd/shell_local.go Replaced all error wrapping calls with fmt.Errorf, added context to error messages throughout node startup and key management
core/cmd/app.go Added logging for configuration file arguments
.changeset/thick-bushes-occur.md Added changeset entry documenting the error handling improvements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/main.go Resolved
Comment thread core/cmd/shell_local.go Resolved
Comment thread core/cmd/shell_local.go Outdated
numVersion, err := strconv.ParseInt(arg, 10, 64)
if err != nil {
return s.errorOut(errors.Errorf("Unable to parse %v as integer", arg))
return s.errorOut(fmt.Errorf("Unable to parse %v as integer", arg))

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

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

Corrected capitalization of 'Unable' to 'unable' to follow Go error message conventions (error messages should not be capitalized unless they begin with a proper noun).

Suggested change
return s.errorOut(fmt.Errorf("Unable to parse %v as integer", arg))
return s.errorOut(fmt.Errorf("unable to parse %v as integer", arg))

Copilot uses AI. Check for mistakes.
Comment thread core/cmd/app.go Resolved
Comment thread core/cmd/shell_local.go Resolved
Comment thread core/cmd/shell_local.go
addressBytes, err := hexutil.Decode(addressHex)
if err != nil {
return s.errorOut(errors.Wrap(err, "could not decode address"))
return s.errorOut(fmt.Errorf("could not decode address '%s': %w", addressHex, err))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@MStreet3 the empty addr would error here

@krehermann
krehermann requested a review from MStreet3 January 27, 2026 18:04
trunk-io[bot]

This comment was marked as outdated.

trunk-io[bot]

This comment was marked as outdated.

trunk-io[bot]

This comment was marked as outdated.

@trunk-io

trunk-io Bot commented Jan 27, 2026 •

Copy link
Copy Markdown

Static Badge   Static Badge   Static Badge   Static Badge

View Full Report ↗︎ ⋅ Docs

@cl-sonarqube-production

Copy link
Copy Markdown

@krehermann
krehermann enabled auto-merge January 27, 2026 21:21
@krehermann
krehermann requested a review from Copilot January 27, 2026 21:21

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/cmd/shell_local.go Resolved
Comment thread core/cmd/shell_local.go
numVersion, err := strconv.ParseInt(arg, 10, 64)
if err != nil {
return s.errorOut(errors.Errorf("Unable to parse %v as integer", arg))
return s.errorOut(fmt.Errorf("unable to parse %v as integer", arg))

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

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

The error message could be more specific by including the actual parsing error. Consider: fmt.Errorf(\"unable to parse %v as integer: %w\", arg, err)

Suggested change
return s.errorOut(fmt.Errorf("unable to parse %v as integer", arg))
return s.errorOut(fmt.Errorf("unable to parse %v as integer: %w", arg, err))

Copilot uses AI. Check for mistakes.
Comment thread core/cmd/shell_local.go Resolved
@krehermann
krehermann added this pull request to the merge queue Jan 27, 2026
Merged via the queue into develop with commit 2420fc6 Jan 27, 2026
215 of 217 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants