FIX Catching situation where database has no tables but it exists

This commit is contained in:
Guy Marriott 2018-11-08 12:05:36 +13:00
parent a0ecbdf4b6
commit 59f6685e2a
No known key found for this signature in database
GPG Key ID: A80F9ACCB86D3DA7

View File

@ -44,8 +44,10 @@ class InitStateMiddleware implements HTTPMiddleware
return $delegate($request); return $delegate($request);
} catch (DatabaseException $ex) { } catch (DatabaseException $ex) {
$message = $ex->getMessage(); $message = $ex->getMessage();
if (strpos($message, 'No database selected') !== false) { if (strpos($message, 'No database selected') !== false
// Database is not ready, ignore and continue || preg_match('/\s*(table|relation) .* does(n\'t| not) exist/i', $message)
) {
// Database is not ready, ignore and continue. Either it doesn't exist or it has no tables
return $delegate($request); return $delegate($request);
} }
throw $ex; throw $ex;