From 6577fc17a92d77fb41af3ef134692bc3bba66843 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 17 Aug 2023 15:54:19 +0100 Subject: [PATCH] Remove ./vendor import and add missing envvars --- app/controllers/api/migrations.php | 18 +++++++++++------- docker-compose.yml | 4 +++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index 870c5d7d80..33c645ef75 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -453,8 +453,8 @@ App::get('/v1/migrations/appwrite/report') $response ->setStatusCode(Response::STATUS_CODE_OK) ->dynamic(new Document($appwrite->report($resources)), Response::MODEL_MIGRATION_REPORT); - } catch (\Exception $e) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, $e->getMessage()); + } catch (\Throwable $e) { + throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Source Error: '.$e->getMessage()); } }); @@ -480,7 +480,7 @@ App::get('/v1/migrations/firebase/report') ->setStatusCode(Response::STATUS_CODE_OK) ->dynamic(new Document($firebase->report($resources)), Response::MODEL_MIGRATION_REPORT); } catch (\Exception $e) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, $e->getMessage()); + throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Source Error: '.$e->getMessage()); } }); @@ -564,7 +564,11 @@ App::get('/v1/migrations/firebase/report/oauth') $firebase = new Firebase($serviceAccount); - $report = $firebase->report($resources); + try { + $report = $firebase->report($resources); + } catch (\Exception $e) { + throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Source Error: '.$e->getMessage()); + } $response ->setStatusCode(Response::STATUS_CODE_OK) @@ -869,7 +873,7 @@ App::get('/v1/migrations/supabase/report') ->setStatusCode(Response::STATUS_CODE_OK) ->dynamic(new Document($supabase->report($resources)), Response::MODEL_MIGRATION_REPORT); } catch (\Exception $e) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, $e->getMessage()); + throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Source Error: '.$e->getMessage()); } }); @@ -901,7 +905,7 @@ App::get('/v1/migrations/nhost/report') ->setStatusCode(Response::STATUS_CODE_OK) ->dynamic(new Document($nhost->report($resources)), Response::MODEL_MIGRATION_REPORT); } catch (\Exception $e) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, $e->getMessage()); + throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Source Error: '.$e->getMessage()); } }); @@ -976,7 +980,7 @@ App::delete('/v1/migrations/:migrationId') } if (!$dbForProject->deleteDocument('migrations', $migration->getId())) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove migration from DB', 500); + throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove migration from DB'); } $events->setParam('migrationId', $migration->getId()); diff --git a/docker-compose.yml b/docker-compose.yml index 567fb9b96e..64ecc0ae99 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -620,11 +620,13 @@ services: - ./app:/usr/src/code/app - ./src:/usr/src/code/src - ./tests:/usr/src/code/tests - - ./vendor:/usr/src/code/tests depends_on: - mariadb environment: - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_OPENSSL_KEY_V1 - _APP_DOMAIN - _APP_DOMAIN_TARGET