Skip to content

Conversation

@ChiragAgg5k
Copy link
Member

No description provided.

@ChiragAgg5k ChiragAgg5k requested a review from Copilot December 16, 2025 17:07
@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch custom-notfound-exception

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

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

Copy link

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 introduces a custom NotFoundException for storage operations to enable more granular error handling when files or objects are not found. The exception replaces generic Exception throws in file-not-found scenarios, allowing calling code to distinguish between not-found errors and other types of failures.

Key Changes:

  • Introduces new NotFoundException class extending Exception
  • Updates S3 device to parse XML error responses and throw NotFoundException for NoSuchKey errors
  • Updates Local device's read() method to throw NotFoundException instead of generic Exception

Reviewed changes

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

File Description
src/Storage/Exception/NotFoundException.php New exception class for file/object not-found scenarios
src/Storage/Device/S3.php Adds parseAndThrowS3Error() method to parse S3 XML errors and throw NotFoundException for NoSuchKey; updates transfer() to throw NotFoundException
src/Storage/Device/Local.php Imports and uses NotFoundException in the read() method instead of generic Exception
tests/Storage/S3Base.php Critical Issue: Removes abstract getAdapterType() method declaration that is still being called and implemented
Comments suppressed due to low confidence (1)

tests/Storage/S3Base.php:26

  • Removing this abstract method declaration will break the test code. The method getAdapterType() is still being called on line 103 of this same file in the testType() method, and all child test classes (AWSTest, BackblazeTest, DOSpacesTest, LinodeTest, WasabiTest) have implementations of this method. Removing the abstract declaration will cause a fatal error when testType() is executed because the method won't be defined in the base class and PHP won't enforce its implementation in child classes.
     */
    abstract protected function getAdapterDescription(): string;

    /**
     * @var S3
     */
    protected $object = null;

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

@ChiragAgg5k ChiragAgg5k force-pushed the custom-notfound-exception branch from f4607cc to f8afc6d Compare December 16, 2025 17:22
@ChiragAgg5k ChiragAgg5k merged commit 7fc437a into 0.18.x Dec 17, 2025
9 checks passed
@ChiragAgg5k ChiragAgg5k deleted the custom-notfound-exception branch December 17, 2025 05:16
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.

3 participants