From 832687dd091c7cc33482e946f5572652b4ebea67 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 16 Sep 2025 23:42:07 +1200 Subject: [PATCH] Catch query exception on bucket/file list --- app/controllers/api/storage.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 8cfeb5da3b..8bc383cabd 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -225,6 +225,8 @@ App::get('/v1/storage/buckets') $total = $dbForProject->count('buckets', $filterQueries, APP_LIMIT_COUNT); } catch (OrderException $e) { throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } $response->dynamic(new Document([ 'buckets' => $buckets, @@ -853,6 +855,8 @@ App::get('/v1/storage/buckets/:bucketId/files') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } catch (OrderException $e) { throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } $response->dynamic(new Document([