Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve error handling in remotedb package #31331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vipocenka
Copy link

This PR improves error handling in the remotedb package by fixing two issues:

  1. In the Has method, we now properly propagate errors instead of silently returning false. This makes the behavior more predictable and helps clients better understand when there are connection issues.

  2. In the New constructor, we add a nil check for the client parameter to prevent potential panics. This follows Go best practices for constructor functions.

These changes make the code more robust and follow Go's error handling idioms without requiring any changes to other parts of the codebase.

Changes:

  • Modified Has method to return errors instead of silently returning false
  • Added nil check in New constructor
  • Fixed field name in constructor to match struct definition

@vipocenka vipocenka requested a review from rjl493456442 as a code owner March 6, 2025 20:00
@vipocenka
Copy link
Author

vipocenka commented Mar 13, 2025

@MariusVanDerWijden ,
I tested debug_dbGet, and it does not return an error when the key is missing.
It just responds with pebble: not found, which means the key is absent but not an actual error.

420993348-3b58f64b-b0da-4375-8b2b-b8e09263f029

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