Skip to content

Conversation

@SaketV8
Copy link
Contributor

@SaketV8 SaketV8 commented Jun 18, 2025

This PR improves the code I previously wrote in PR #133

🚀 The improvements I implemented:

  • This PR improves the error message returned when attempting to update a book that does not exist or hasn't been modified.

  • It enhances the error message shown when trying to delete a book that has already been deleted.

  • It also refines the error messages displayed when required fields are missing while adding a new book

  • It also improves the error message returned when getting book by ID by passing empty bookID

✨ fixed some readme typo too.

… or empty

Signed-off-by: Saket Maurya <mauryapriyadarshi2004@gmail.com>
Copilot AI review requested due to automatic review settings June 18, 2025 15:33
@SaketV8 SaketV8 requested a review from khareyash05 as a code owner June 18, 2025 15:33
@keploy
Copy link

keploy bot commented Jun 18, 2025

To generate Unit Tests for this PR, please click here.

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 adds input validation for empty or missing fields across various book handlers and enhances related error messages, fixes a typo in the README, and introduces a default Keploy configuration file.

  • Added checks for empty book_id in GetBookByIDHandler and refined its error response
  • Introduced validation logic in AddBookHandler and UpdateBookHandler to catch missing/invalid fields
  • Improved DeleteBookHandler with “not found or already deleted” handling
  • Fixed a missing closing quote in the README command snippet
  • Added keploy.yml with default settings

Reviewed Changes

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

File Description
pkg/handlers/book_handler.go Added validation logic and more descriptive error messages in handlers for get, add, delete, and update book operations
keploy.yml Added default Keploy configuration file
README.md Corrected missing closing quote in Keploy command example

@pratik-mahalle
Copy link

Hey @SaketV8, Thank you for raising the pr! Our team will review it soon

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