cieslarmichal / bucketeer

A platform for seamless file exploration and transfer to and from AWS S3. Focuses on serving images and videos.
5 stars 0 forks source link

[BE] Better error handling for bucket missing #83

Closed DeutscherDude closed 3 months ago

DeutscherDude commented 3 months ago

As is

Currently, when a bucket does not exist, the response is a 500, Internal Server Error.

Desired state

The application returns a 400 - bad request and provides a proper error message.

Sample log from the backend:

{"level":50,"time":1722255102242,"pid":14033,"hostname":"jakubs","name":"Logger","context":{"endpoint":"GET /api/buckets/some-bucket-99123/resources?pageSize=10","error":{"name":"NoSuchBucket","message":"The specified bucket does not exist","stack":"NoSuchBucket: The specified bucket does not exist\n    at de_NoSuchBucketRes )"}},"msg":"Caught an error in the HTTP server."}
cieslarmichal commented 3 months ago

how can I reproduce that?