mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Merge pull request #389 from creative-commoners/pulls/2.1/dont-catch-exceptions
FIX Only continue delegation when DB exceptions are caused by no database selected
This commit is contained in:
commit
fa3f1fa767
@ -43,8 +43,12 @@ class InitStateMiddleware implements HTTPMiddleware
|
||||
|
||||
return $delegate($request);
|
||||
} catch (DatabaseException $ex) {
|
||||
// Database is not ready
|
||||
return $delegate($request);
|
||||
$message = $ex->getMessage();
|
||||
if (strpos($message, 'No database selected') !== false) {
|
||||
// Database is not ready, ignore and continue
|
||||
return $delegate($request);
|
||||
}
|
||||
throw $ex;
|
||||
} finally {
|
||||
// Persist to the session if using the CMS
|
||||
if ($state->getUseSessions()) {
|
||||
|
Loading…
Reference in New Issue
Block a user