Skip to content

Conversation

@akhrarovsaid
Copy link
Contributor

What?

In a similar vein to #11734, #11733, #10327 - this PR returns a 404 in the response when a file is not found while using the storage-gcs adapter. Currently a 500 is returned.

Why?

To return the correct error level in the response when a file is not found when using storage-gcs.

How?

The GCS nodejs library exposes the ApiError as a general error - these changes check that the caught error is an instance of this class and if the provided code is a 404.

@akhrarovsaid akhrarovsaid changed the title fix(storage-gcs): return 404 on file not found fix(storage-gcs): return 404 on file not found instead of 500 Jun 10, 2025
@paulpopus paulpopus changed the title fix(storage-gcs): return 404 on file not found instead of 500 fix(storage-gcs): return error status 404 on file not found instead of 500 Jun 11, 2025
@paulpopus paulpopus merged commit d8626ad into payloadcms:main Jun 11, 2025
79 checks passed
@akhrarovsaid akhrarovsaid deleted the fix/gcs-return-404 branch June 11, 2025 14:08
@github-actions
Copy link
Contributor

🚀 This is included in version v3.43.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants