From 19bcfd27ddf1932ec88da4e6ae677f4e15c34c97 Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Mon, 18 Sep 2017 18:02:56 -0500 Subject: [PATCH] handle deleting of class that doesn't exist (#4184) --- src/Adapters/Storage/Postgres/PostgresStorageAdapter.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js index bce54a4c..8164243c 100644 --- a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js +++ b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js @@ -981,6 +981,12 @@ export class PostgresStorageAdapter { } else { return count; } + }).catch((error) => { + if (error.code === PostgresRelationDoesNotExistError) { + // Don't delete anything if doesn't exist + } else { + throw error; + } }); } // Return value not currently well specified.