Skip to content

fix: handle interface registry creation errors#133

Merged
AdriaCarrera merged 1 commit into
mainfrom
fix/interface-registry-error
May 13, 2026
Merged

fix: handle interface registry creation errors#133
AdriaCarrera merged 1 commit into
mainfrom
fix/interface-registry-error

Conversation

@kpitapeersyst
Copy link
Copy Markdown
Contributor

@kpitapeersyst kpitapeersyst commented May 4, 2026

fix: handle interface registry creation errors

Motivation 💡

  • types.NewInterfaceRegistryWithOptions can return an error, but MakeEncodingConfig ignored it.

Changes 🛠

  • Panic if an error is returned when creating the interface registry.

Considerations 🤔

  • MakeEncodingConfig does not return an error, and the app cannot continue with a failed interface registry, so failing fast is appropriate here.

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling during application initialization to prevent silent failures and provide clearer error reporting when registry creation encounters issues.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0a68fe15-2c5c-4f9a-8cc7-5870f6bca914

📥 Commits

Reviewing files that changed from the base of the PR and between 43c1c36 and 3111fd6.

📒 Files selected for processing (1)
  • app/encoding.go

📝 Walkthrough

Walkthrough

The PR enhances error handling in app/encoding.go by importing fmt and updating MakeEncodingConfig to panic with a wrapped error message when interface registry creation fails, rather than silently ignoring the error.

Changes

Error Handling in Encoding Configuration

Layer / File(s) Summary
Imports
app/encoding.go
Added fmt import to support error wrapping.
Error Handling
app/encoding.go
MakeEncodingConfig now captures errors from types.NewInterfaceRegistryWithOptions and panics with fmt.Errorf wrapping when registry creation fails, instead of discarding the error with a blank identifier.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A rabbit hops through code so keen,
Errors caught, no longer unseen!
From silent blanks to panics clear,
Init problems now we fear—but hear! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and concisely describes the main change: adding error handling for interface registry creation failures.
Description check ✅ Passed The description follows the template with completed Motivation, Changes, and Considerations sections, though Dependencies section is omitted as not applicable.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/interface-registry-error

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

@AdriaCarrera AdriaCarrera merged commit 5f13c32 into main May 13, 2026
6 checks passed
@AdriaCarrera AdriaCarrera deleted the fix/interface-registry-error branch May 13, 2026 09:47
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.

2 participants