Skip to content

Conversation

@hrntknr
Copy link
Member

@hrntknr hrntknr commented Aug 19, 2025

Summary

(Brief description of what this PR accomplishes)

Type of Change

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to our CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit

Related Issues

- Use fosite.ErrNotFound for consistent error responses
- Remove redundant bucket existence checks
- Simplify error handling in update method
Copilot AI review requested due to automatic review settings August 19, 2025 13:54
@hrntknr hrntknr merged commit 126ff82 into main Aug 19, 2025
4 checks passed
Copy link
Contributor

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 PR improves error handling in the KVS repository by standardizing error types and removing unnecessary bucket existence checks.

  • Replace custom error messages with standardized fosite error types
  • Remove redundant bucket existence checks that are unnecessary when accessing existing buckets
  • Simplify error handling logic in delete and update operations

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

data, err := json.Marshal(value)
if err != nil {
return fmt.Errorf("failed to marshal value: %w", err)
return fosite.ErrNotFound
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

Returning fosite.ErrNotFound for a JSON marshaling error is incorrect. This error type should only be used when a resource is not found, not when serialization fails. The original error wrapping should be retained: return fmt.Errorf(\"failed to marshal value: %w\", err)

Copilot uses AI. Check for mistakes.
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